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回答
提交回答
  • 至过去的我

    2044人对此回答表示赞同

    我是未来的你,你现在是不是在年找寻小程序答案。你不要感觉诧异,给你来信原因,就是让你不在后悔。今天去学习如何推广小程序,相信......点击查看更多>
    发布于
  • Charles

    9人对此回答表示赞同

    ????@Lwx.downloadFile({

    展开
    9
    4回复
    发布于 6年前

    评论(4)

    收起评论

    • 刘思杰 2019-02-21 11:12

      你所提供的代码片段无法正常运行哦,

      回复
    • Caleb 2019-02-23 19:42

      wechatide://minicode/jzfG5PmD7e1l

      回复
    • Joseph 2019-02-25 12:56

      touristappid

      回复
    • Sophia 2019-02-27 10:19

      请使用代码片段功能提供可复现问题的代码片段:

      回复
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
咨询热线

13312967497

扫码添加业务即可随时咨询 还可领取小程序推广攻略

业务咨询: 13312967497
扫码咨询

扫码咨询套餐

回到顶部