开发者社区> 问答> 正文

文件重复上传的问题

使用的是阿里云的文件上传功能,Android sdk,oss-android-sdk:2.3.0。
使用的代码即 https://help.aliyun.com/document_detail/32047.html?spm=5176.doc31886.6.342.doSOgQ 中的异步上传代码,但是发现文件会被上传多次。日志如下:

09-28 17:01:23.616 16201-17419/com.yixin.aoyou D/ETag: 6CDD76F367919FF876763BBFE61C038E
09-28 17:01:23.616 16201-17419/com.yixin.aoyou D/RequestId: 57EB86D3031C878F36BDD26C
09-28 17:01:23.622 16201-18039/com.yixin.aoyou D/PutObject: currentSize: 2048 totalSize: 952724
09-28 17:01:23.624 16201-18039/com.yixin.aoyou D/PutObject: currentSize: 4096 totalSize: 952724
09-28 17:01:23.626 16201-18039/com.yixin.aoyou D/PutObject: currentSize: 6144 totalSize: 952724
……
09-28 17:01:23.834 16201-18039/com.yixin.aoyou D/PutObject: currentSize: 950272 totalSize: 952724
09-28 17:01:23.835 16201-18039/com.yixin.aoyou D/PutObject: currentSize: 952320 totalSize: 952724
09-28 17:01:23.835 16201-18039/com.yixin.aoyou D/PutObject: currentSize: 952724 totalSize: 952724
09-28 17:01:23.920 16201-18039/com.yixin.aoyou D/PutObject: currentSize: 2048 totalSize: 952724
09-28 17:01:23.920 16201-18039/com.yixin.aoyou D/PutObject: currentSize: 4096 totalSize: 952724
09-28 17:01:23.921 16201-18039/com.yixin.aoyou D/PutObject: currentSize: 6144 totalSize: 952724
09-28 17:01:23.922 16201-18039/com.yixin.aoyou D/PutObject: currentSize: 8192 totalSize: 952724
……
09-28 17:01:25.281 16201-18039/com.yixin.aoyou D/PutObject: currentSize: 948224 totalSize: 952724
09-28 17:01:25.282 16201-18039/com.yixin.aoyou D/PutObject: currentSize: 950272 totalSize: 952724
09-28 17:01:25.283 16201-18039/com.yixin.aoyou D/PutObject: currentSize: 952320 totalSize: 952724
09-28 17:01:25.284 16201-18039/com.yixin.aoyou D/PutObject: currentSize: 952724 totalSize: 952724
09-28 17:01:26.135 16201-16211/com.yixin.aoyou W/art: Suspending all threads took: 12.062ms
09-28 17:01:26.187 16201-16216/com.yixin.aoyou W/art: Suspending all threads took: 21.388ms
09-28 17:01:26.194 16201-16216/com.yixin.aoyou I/art: Background sticky concurrent mark sweep GC freed 5945(278KB) AllocSpace objects, 8(902KB) LOS objects, 0% free, 137MB/138MB, paused 26.155ms total 40.796ms

其中 OSSCompletedCallback 的 onSuccess 执行一次没有问题,但是 OSSProgressCallback 的 onProgress 重复执行,请确认一下是什么问题?

展开
收起
大尾巴鱼 2016-09-28 17:18:44 6276 0
1 条回答
写回答
取消 提交回答
  • 码农|Coder| Pythonista

    onprogress 是用来展示上传进度的

    2019-07-17 20:12:40
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
附件下载测试 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载