代码:
chooseAll() {
wx.chooseMessageFile({
count: 1,
type: 'all',
success:res=> {
// console.log(res)
var tempFiles = res.tempFiles[0]
this.uploadAll(tempFiles.name, tempFiles.path)
}
})
},
uploadAll(name, temFile) {
wx.cloud.uploadFile({
cloudPath: name,
filePath: temFile,
success: res => {
console.log("上传成功", res)
},
fail(err) {
console.log("上传失败", err)
}
})
},
网友评论