QNUploadOption * option = [[QNUploadOption alloc] initWithMime:@"image/png" progressHandler:nil params:nil checkCrc:NO cancellationSignal:nil];
QNUploadManager * uploadManager = [[QNUploadManager alloc] init];
NSString * documentDIR = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
[uploadManager putFile:[documentDIR stringByAppendingPathComponent: photoModel.filePath] key:response.body[@"key"] token:response.body[@"uptoken"] complete:^(QNResponseInfo *info, NSString *key, NSDictionary *resp) {
NSLog(@"upload info : %@", info);
NSLog(@"upload resp : %@", resp);
} option:option];
我生成拍照文件的就是PNG图片,经由服务器获取token后,拿着去上传。【之前我也有尝试过option传nil,但也是不行】
返回值每次都是:
Printing description of info:
<QNResponseInfo= id: CA426F62-51EB-4724-BF1A-56FC8628108D, ver: 7.0.19, status: 400, requestId: sgYAAA-RI4ZvQXcU, sgYAAA-RI4ZvQXcU, xlog: UP:3/400;UP:18/400, xvia: 1.1 tietong99:2 (Cdn Cache Server V2.0), host: upload.qiniu.com ip: 222.42.4.112 duration: 0.165821 s time: 1474719350 error: Error Domain=qiniu.com Code=400 "(null)" UserInfo={error=incorrect zone, please use up-z1.qiniu.com}>
不知道哪里出错了
I encountered this problem, have you solved it? How did you do it
It’s a path problem. Follow the prompts and replace qiniu.com with up-z1.qiniu.com. Two methods
1. If you search for qiniu.com in the project, you will find that there are two methods, one is zone0 and one is zone1. Change qiniu.com inside to up-z1.qiniu.com