使用的是阿里云的文件上传功能,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 重复执行,请确认一下是什么问题?
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。