收藏
回答

wx.downloadFile()与wx.getImageInfo()6.7.2

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug wx.downloadFile()与wx.getImageInfo() 客户端 6.7.2 2.2.3

wx.downloadFile()与wx.getImageInfo()获取不到返回值


wx.downloadFile({

url: 'https://dz-b2be19.tcb.qcloud.la/my-photo.png?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDXxCFD27Lo6HVecr4WpwseIl3DCzZJJQM%26q-sign-time%3D1534741250%3B1534742150%26q-key-time%3D1534741250%3B1534742150%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3D3e19d2c9323ff4cd088e8360571c0b8856bc43b0', /

success: function (res) {

console.log(res.tempFilePath)

if (res.statusCode === 200) {

wx.playVoice({

filePath: res.tempFilePath

})



wx.getImageInfo({

src: 'https://dz-b2be19.tcb.qcloud.la/my-photo.png?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDXxCFD27Lo6HVecr4WpwseIl3DCzZJJQM%26q-sign-time%3D1534741250%3B1534742150%26q-key-time%3D1534741250%3B1534742150%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3D3e19d2c9323ff4cd088e8360571c0b8856bc43b0',

success: function (res3) {

console.log("输出图片信息")

console.log(res3.width)

console.log(res3.height)

},

fail: function (res) {

console.log(res)

}

})



开发工具输出

downloadFile:undefined

getImageInfo:{errMsg: "getImageInfo:fail file not found"}


phone6 输出

downloadFile:正常返回

getImageInfo:{errMsg: "getImageInfo:fail image not found"}


三星s8输出

downloadFile:正常返回

getImageInfo: -1 -1





回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容