深蓝的一片海
深蓝的一片海
  • 发布:2022-09-23 15:55
  • 更新:2022-09-23 19:33
  • 阅读:277

【报Bug】在ios手机上uniCloud.uploadFile不走onUploadProgress方法

分类:uniCloud

产品分类: uniCloud/腾讯云

示例代码:

const result = await uniCloud.uploadFile({
filePath: filePath,
cloudPath: + new Date() + ('000000' + Math.floor(Math.random() * 999999)).slice(-6) + '.jpg',
onUploadProgress: e=> {

                    this.uploadProgress = Math.round(  
                        (e.loaded * 100) / e.total  
                    );  
                    console.log(this.uploadProgress,"进度");  
                }  
            });  
            console.log(this.uploadProgress,"进11111111度");  
            console.log(result,"进2222度");  
            if(!result.fileID){  
                this.$util.msg('头像上传失败');  
                return;  
            }  
            if(typeof uniCloud.getTempFileURL === 'undefined'){  
                this.userInfo.avatar = result.fileID;  
            }else{  

                const tempFiles = await uniCloud.getTempFileURL({  
                    fileList: [result.fileID]  
                })  
                const tempFile = tempFiles.fileList[0];  
                if(tempFile.download_url || tempFile.fileID){  
                    console.log(empFile.download_url,"图片");  
                    this.userInfo.avatar = tempFile.download_url || tempFile.fileID;  
                }else{  
                    this.$util.msg('头像上传失败');  
                }  
            }

操作步骤:

调用uniCloud.uploadFile上传图片

预期结果:

希望显示进度

实际结果:

不走进度的方法

bug描述:

在ios手机上uniCloud.uploadFile不走onUploadProgress方法

2022-09-23 15:55 负责人:无 分享
已邀请:
深蓝的一片海

深蓝的一片海 (作者) - 90后IT男

在安卓上可以

DCloud_uniCloud_WYQ

DCloud_uniCloud_WYQ

调用uni.uploadFile 地址改成 https://httpbin.org/post 试试看走不走 onUploadProgress

要回复问题请先登录注册