开发者社区> 问答> 正文

iOS上传回调失败

error: Error Domain=com.aliyun.oss.serverError Code=-203 "(null)" UserInfo={__name=Error, HostId=yayi-avatar.oss-cn-hangzhou.aliyuncs.com, Message=Error status : 500., Code=CallbackFailed, RequestId=595DE73BDD373EE829329276}

展开
收起
缘诚煦 2017-07-06 15:34:25 3623 0
2 条回答
写回答
取消 提交回答
  • ReiOS上传回调失败
          OSSPutObjectRequest *request = [OSSPutObjectRequest new ];
          request. bucketName = @"yayi-avatar";
          request. objectKey = [ NSString stringWithFormat: @"doctor2/%@.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-07 10:47:28
    赞同 展开评论 打赏
  • 上传回调代码是什么样的?
    2017-07-07 08:43:50
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
移动 App 性能监测实践(iOS篇) 立即下载
深入剖析 iOS 性能优化 立即下载
深入剖析iOS性能优化 立即下载