收藏
回答

图片上传损坏

问题类型 API/组件名称 AppID 微信版本 基础库版本
Bug 图片上传 wxe9809efbb7a356f9 6.7.3 1.0.0

- 图片上传损坏



- 有的图片能上传成功,有的上传之后变成如图,请问应该怎么解决


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

2 个回答

  • W。
    W。
    2020-09-23

    楼主的问题解决了吗 ?我也出现了相同的问题

    2020-09-23
    有用
    回复 1
    • 禾店科技
      禾店科技
      2021-04-28
      同问
      2021-04-28
      回复
  • 是小白啊
    是小白啊
    2018-10-25

    提供一下出现问题的机型和微信版本,以及能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

    2018-10-25
    有用
    回复 11
    • 2018-10-25

      // 手机机型iphone 6splus  版本10.2

      // 微信版本6.7.3

      // 选择照片代码

      chooseimage_sh: function () {

      var _this = this;

      var openid;

      wx.getStorage({

      key: 'openid',

      success: function (res_openid) {

      // console.log(res_openid.data)

      wx.chooseImage({

      count: 1, // 默认9

      sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有  

      sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有  

      success: function (res) {

      // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片

      _this.setData({

      tempFilePaths_sh: res.tempFilePaths[0]

      array4: res.tempFilePaths

      })

      if (typeof (_this.data.tempFilePaths_sh) != "undefined") {

      _this.setData({

      img_sh:'section_img_close',

      })

      }

      }

      })

      }

      })


      },

      // 上传代码

      wx.uploadFile({

      url: getApp().globalData.ip+'/Interface/I_File.ashx?action=uploadzp&i='+i+'&txkey=' + this_.txkey +'&shzkey=' + this_.shzkey,

      filePath: arr_v,

      name: 'file',

      success: function (res) {

      }

      })


      2018-10-25
      回复
    • 是小白啊
      是小白啊
      2018-10-25回复

      按照教程提供:https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

      2018-10-25
      回复
    • 2018-10-25回复

      // 上传文件代码少发了些

      var arr_v;

      arr_v = this_.tempFilePaths[0];


      2018-10-25
      回复
    • 2018-10-25回复是小白啊

      wechatide://minicode/tSB11qmp7b3P

      这样可以吗

      2018-10-25
      回复
    • 是小白啊
      是小白啊
      2018-10-26回复

      在哪里上传图片

      2018-10-26
      回复
    查看更多(6)
登录 后发表内容