WeChat Mini Programs failed to upload pictures


WeChat Mini Programs uploads a picture and reports this error. Is it a problem with the interface

?

here is the code

  chooseImage: function() {
    wx.chooseImage({
      count: 1, // 9
      sizeType: ["compressed"], // 
      sourceType: ["album", "camera"], // 
      success: function (res) {
        // tempFilePathimgsrc
        var tempFilePaths = res.tempFilePaths
        console.log(tempFilePaths)
        wx.uploadFile({
          url: "https://wxapi.ygjsw.org/index.php/api/v1/upload_img", //
          filePath: tempFilePaths[0],
          name: "file",
          formData: {
            "user": "test"
          },
          success: function (res) {
            var data = res.data
            //do something
            console.log(res)
          },
          fail: function(err) {
            console.log(err)
          }
        })
      }
    })
  }
Mar.28,2021

sometimes it is a problem with the simulator. Try publishing it online, maybe it will be OK

there have been people who have encountered problems like thinking


have you tried it on your phone?

Menu