微信小程序上傳圖片, 報這個錯誤, 是接口的問題嗎下面是代碼 chooseImage: function() { wx.chooseImage({ count: 1, // 默認(rèn)9 sizeType: ['compressed'], // 可以指定是原圖還是壓縮圖,默認(rèn)二者都有 sourceType: ['album', 'camera'], // 可以指定來源是相冊還是相機,默認(rèn)二者都有 success: function (res) { // 返回選定照片的本地文件路徑列表,tempFilePath可以作為img標(biāo)簽的src屬性顯示圖片 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) } }) } }) }
微信小程序 上傳圖片失敗
慕虎7371278
2019-03-22 10:15:45