开发者社区> 问答> 正文

上传多张图片

OSSPutObjectRequest * put = [OSSPutObjectRequest new];

put.bucketName = @"fzyouke";
put.objectKey = [NSString stringWithFormat:@"klxz/taskios/%@.jpg",name];
put.uploadingFileURL = [NSURL fileURLWithPath:urlpath];
put.uploadProgress = ^(int64_t bytesSent, int64_t totalByteSent, int64_t totalBytesExpectedToSend) {
    NSLog(@"%lld, %lld, %lld", bytesSent, totalByteSent, totalBytesExpectedToSend);
};
OSSTask * putTask = [ossclient putObject:put];

[putTask continueWithBlock:^id(OSSTask *task) {
    NSLog(@"objectKey: %@---tsak-->>%@", put.objectKey,task.error);
    if (!task.error) {
        NSLog(@"upload object success!");
    } else {
        NSLog(@"upload object failed, error: %@" , task.error);
    }
    return nil;
}];

我想一次性上传 9张。怎么操作???

展开
收起
小唐121 2017-11-22 10:17:24 2598 0
1 条回答
写回答
取消 提交回答
  • 目前只能删除多个文件,上传多个文件的接口还不提供.

    2019-07-17 21:44:46
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载