bindButtonTap1: function () {
var that = this
wx.chooseImage({
count: 1, // 默认9
sizeType: [‘compressed’],
sourceType: [‘album’, ‘camera’],
success: function (res) {
var tempFilePaths = res.tempFilePaths
that.setData({
paths: tempFilePaths[0]
})
wx.uploadFile({
url: ‘https://www.XXXXXXX/test-wechat’,
filePath: tempFilePaths[0],
name: ‘file’,
formData: {
‘user’: ‘test’
},
success: function (res) {
var data = res.data
//do something
}
})
}
})
}
小程序中采集到了图片并且本地可以预览出来,但是服务端用Java捕获流的时候是空的,请问用Java在后端接收上传的图片文件应该怎么做?