发布时间:2022-12-07 22:00
chooseMessageFile: function (e) {
var that = this;
wx.chooseMessageFile({
count: 1,
type: 'file',
success(res) {
var filename = res.tempFiles[0].name
console.info(filename);
that.setData({filename:filename});
wx.uploadFile({
url: app.globalData._server + "/test/object/upload",
filePath: res.tempFiles[0].path,
name: 'uploadFile',
success(res) {
//json字符串 需用JSON.parse 转
}
})
}
});
}