wx.chooseImage({
count: 1,
sizeType: [‘compressed’],
success: function(info){
var paths = info.tempFilePaths;
wx.uploadFile({
url: url, //服务器上传地址
filePath: paths[0],
name: ‘file’, //上传文件对应表单字段
header: { //请求头
‘content-type’: ‘application/x-www-form-urlencoded’
},
formData: {type: ‘jpg’}, //其他额外的表单字段
success: function(res, code){
}
});
}
});
5 回复