Version. 2.4.1 (14491) wx.getFileInfo({ filePath: args[0].filePath, success (res) { // console.log('getFileInfo-111-', res) if (res.size > 20 * 1024 * 1023) { wx.compressImage({ src: args[0].filePath, success: res => { // console.log('compressImage--', res) args[0].filePath = res.tempFilePath wx.getFileInfo({ filePath: args[0].filePath, success (res) { // console.log('getFileInfo-222-', res) if (res.size > 20 * 1024 * 1023) { showFail({ errMsg: 'file still too large after compress' }) } else { wx.uploadFile(...args) } }, fail: showFail }) }, fail: showFail }) } else { wx.uploadFile(...args) } }, fail: showFail })
compressImage 在电脑端崩溃在电脑上,上传大于20M的图片,在调用 wx.compressImage 接口后报错(手机上没事) [图片]
2020-05-29