开发者社区> 问答> 正文

iOS上传回调失败

error: Error Domain=com.aliyun.oss.serverError Code=-203 "(null)" UserInfo={__name=Error, HostId=ssfd-avatar.oss-cn-hangzhou.aliyuncs.com, Message=Error status : 500., Code=CallbackFailed, RequestId=595DE73BDD373EE829329276}      代码是这样写的,不知道为什么,上传图片,一直报上面的错误,我没发现我的代码有什么问题







      OSSPutObjectRequest *request = [OSSPutObjectRequest new ];       request. bucketName = @"ssfd-avatar";       request. objectKey = [ NSString stringWithFormat: @"%@.jpg",[ self MD5:append]];         request. callbackParam = @{                           @"callbackUrl":url,                           @"callbackBody" :@"ossurl=http://${bucket}.oss-cn-hangzhou.aliyuncs.com/${object}&userid=${x:userid}"                           };       request. callbackVar = @{ @"x:userid":userid };           request. uploadingData = data;        request. contentType = @"image/jpeg";       request. uploadProgress = ^( int64_t bytesSent, int64_t totalByteSent, int64_t totalBytesExpectedToSend) {             NSLog( @"%lld, %lld, %lld", bytesSent, totalByteSent, totalBytesExpectedToSend);         };       OSSTask * task = [ client putObject:request];       [task continueWithBlock:^ id( OSSTask *task) {             if (!task. error) {                 OSSPutObjectResult *result = task. result;                  NSLog (@"upload object success!" );                                               } else {                 fail( true);                  NSLog ( @"upload object failed, error: %@" , task. error );             }             return nil;         }];

展开
收起
缘诚煦 2017-07-14 10:41:31 3443 0
2 条回答
写回答
取消 提交回答
  • ReiOS上传回调失败
    测试了,还是传不上去,不知道什么问题
    2017-07-17 10:17:29
    赞同 展开评论 打赏
  • 先用官方的例子测试i一下?

    -------------------------

    官方的例子也是报一样的错误吗,先检查下AK,SK,ENDPOINT哪些配置写对了没?

    2017-07-15 05:05:40
    赞同 展开评论 打赏
问答分类:
问答标签:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
手淘iOS性能优化探索 立即下载
From Java/Android to Swift iOS 立即下载
深入剖析iOS性能优化 立即下载