收藏
回答

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 个回答

  • 是小白啊
    是小白啊
    2018-08-20

    你好,请提供一下能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

    2018-08-20
    有用
    回复 5
    • y
      y
      2018-08-20

      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)

      }

      })


      2018-08-20
      回复
    • 是小白啊
      是小白啊
      2018-08-20回复y

      你好,请使用代码片段功能提供可复现问题的代码片段:https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

      2018-08-20
      回复
    • y
      y
      2018-08-21回复是小白啊

      touristappid

      2018-08-21
      回复
    • y
      y
      2018-08-21回复是小白啊

      wechatide://minicode/jzfG5PmD7e1l

      2018-08-21
      回复
    • 是小白啊
      是小白啊
      2018-08-21回复y

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

      2018-08-21
      回复
登录 后发表内容