3,143
社区成员
发帖
与我相关
我的任务
分享
js
wx.uploadFile({
url: app.globalData.interfaceUrl+'SecondHand/PostFile',
filePath:res.tempFilePaths[0],
name:'image',
header: { "Content-Type": "multipart/form-data" },
// formData: {
// filePath:res.tempFilePaths[0]
// }, // HTTP 请求中其他额外的 form data
success: function(res){
var resData = res.data;
// success
},
fail: function(res) {
// fail
var resData =res;
},
complete: function() {
// complete
}
})
后台
public string PostFile()
{
HttpPostedFile file = HttpContext.Current.Request.Files[0];
}