如图安卓端已成功上传,并开辟空间华南,token是从后台获取的就是传不上去求高手指引
// 华南
QNConfiguration *config = [QNConfiguration build:^(QNConfigurationBuilder *builder) { builder.zone = [QNZone zone2]; QNUploadManager *upManager = [[QNUploadManager alloc] initWithConfiguration:config];
// params:nil
// checkCrc:NO
// cancellationSignal:nil];
// NSString * token = @"从服务端SDK获取"; // NSString * key = @"指定七牛服务上的文件名,或nil"; // NSString * filePath = @"要上传的文件路径"; UIImage *image = [UIImage imageNamed:@"tab@3x"]; NSData *data = UIImagePNGRepresentation(image); [upManager putData:data key:nil token:token complete:^(QNResponseInfo *info, NSString *key, NSDictionary *resp) { if(info.ok) { NSLog(@"请求成功"); } else{ NSLog(@"失败"); //如果失败,这里可以把info信息上报自己的服务器,便于后面分析上传错误原因 } NSLog(@"info ===== %@", info); NSLog(@"resp ===== %@", resp); } option:nil]; }];
以下为7牛返回内容(错误)
info =====