uni-app ios平台QQ中上传文件无法使用base64

uni-app ios平台QQ中上传文件无法使用base64

字段
PC开发环境操作系统 Mac
PC开发环境操作系统版本号 12.1
HBuilderX类型 正式
HBuilderX版本号 3.3.5
浏览器平台 QQ内置浏览器
浏览器版本 未知
项目创建方式 HBuilderX

示例代码

uni.canvasToTempFilePath({  
    destWidth: 400,  
    destHeight: 80,  
    quality: 0.5,  
    canvasId: 'mycanvas',  
    success: async function(res) {  
        // console.log(res);  
        let result = await uniCloud.uploadFile({  
            filePath: res.tempFilePath,  
            // fileContent:uni.base64ToArrayBuffer(res.tempFilePath),  
            cloudPath: 'order/' + that.order.name + "_" +  
                (new Date().getTime()) + '.jpg',  
            success(e) {  
                console.log(e);  
                //上传到服务器并返回地址  
                that.order.signs[that.signingId].imgUrl = e.fileID;  
                that.show = "sign";  
                uni.hideLoading();  
            },  
            fail(e) {  
                alert(e);  
            }  
        }, this);                                                 
    },  
    fail(e) {  
        alert(e);  
    }  
}, this);

更多关于uni-app ios平台QQ中上传文件无法使用base64的实战教程也可以访问 https://www.itying.com/category-93-b0.html

回到顶部