wx.chooseImage({
success (res) {
const tempFilePaths = res.tempFilePaths
wx.uploadFile({
url: 'https://******/uploadPic.ashx', //仅为示例,非真实的接口地址
filePath: tempFilePaths[0],
name: 'uploadfile',
formData: {
'user': 'test'
},
success (res){
const data = res.data
console.log(data)
//do something
}
})
}
})
后端ashx
HttpPostedFile file = context.Request.Files[“uploadfile”];//接收
打印一直是null,无法接收到前端上传的文件路径?????????????????