代码部分:
uni.chooseImage({
count: 1,
// res result的简写
success(res){
const tempFilepath = res.tempFilePaths[0]
console.log(tempFilepath)
// 上传文件到云端
uniCloud.uploadFile({
filePath:tempFilepath,
success(res) {
console.log(res)
},
fail(res) {
console.log(res)
}
})
},
fail(res){
console.log(res)
}
})
报错提示:
Error: cloudPath必须为字符串类型
at D.uploadFile (null:1:15633)
at D.e.uploadFile (null:1:63899)
at D.t.<computed> (null:1:64269)
at null:1:9317
2 个回复
DCloud_uniCloud_WYQ
uniCloud.uploadFile需要一个cloudPath才能上传
1***@qq.com
cloudPath是给一个在云端的名字