wx.chooseImage ({
success (res) {
const tempFilePaths = res.tempFilePaths
wx.uploadFile({
url: "https://example.weixin.qq.com/upload", //
filePath: tempFilePaths[0],
name: "file",
formData: {
"user": "test"
},
success (res){
const data = res.data
//do something
}
})
}
})
this is the method of uploading pictures in the official document.
the filePath in wx.uploadFile. Does it have to be the picture selected by wx.chooseImage?
I once tried filePath to send an address directly, but I made a mistake.