开发者社区> 问答> 正文

文件重复上传的问题

大尾巴鱼 2016-09-28 17:18:44 2494

使用的是阿里云的文件上传功能,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 重复执行,请确认一下是什么问题?

Java 开发工具 Android开发
分享到
取消 提交回答
全部回答(1)
  • 西秦说云
    2019-07-17 20:12:40

    onprogress 是用来展示上传进度的

    0 0

集结各类场景实战经验,助你开发运维畅行无忧

推荐文章
相似问题