Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
422 views
in Technique[技术] by (71.8m points)

ios上传到7牛华南区失败求解?

如图安卓端已成功上传,并开辟空间华南,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 ===== <QNResponseInfo= id: 557CF907-3307-447C-BB48-BDF7E349BBEE, ver: 7.1.5, status: 400, requestId: CAwAAG5kKu5c1aYU, CAwAAG5kKu5c1aYU, xlog: body:9;UP:9/400;UP:9/400, xvia: (null), host: upload.qiniu.com ip: 183.131.7.18 duration: 0.051881 s time: 1488111322 error: Error Domain=qiniu.com Code=400 "(null)" UserInfo={error=incorrect region, please use up-z2.qiniu.com}>


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...