上传后 删除文件没有权限!!!
来源:4-8 使用云储存上传文件

慕粉1494638
2020-07-09
//上传图片
/*
let self = this;
uni.chooseImage({
count:1,
success(res) {
const tempFilePath = res.tempFilePaths[0];
const filename = res.tempFiles[0].name;
console.log(tempFilePath);
console.log(filename);
uniCloud.uploadFile({
cloudPath:filename,
filePath: tempFilePath,
success(res) {
console.log(res);
self.src = res.fileID;
},
fail() {
console.log(err);
}
})
},
fail(err) {
console.log(err)
}
})
*/
uniCloud.deleteFile({
fileList:['https://vkceyugu.cdn.bspapp.com/VKCEYUGU-uni0bf8d11/67be443c-4e2a-4f7a-9e2e-ce001e75453c.jpg'],
success(res) {
console.log(res)
},
fail(err) {
console.log(err);
}
})
写回答
5回答
-
甜了四季i
2020-07-20
非常硬核的删除
112021-01-11 -
甜了四季i
2020-07-20
我自己找了一个办法在客户端删除文件,用uniCloud.callFunction在data里面添加一个要删除文件的路径,然后在云函数中用event调用data里面的那个路径
00 -
Bug制造专家
2020-07-18
已经不支持客户端删除了,需要将删除方法写在云函数中
uniCloud.deleteFile({ fileList:['https://vkceyugu.cdn.bspapp.com/VKCEYUGU-uni0c8a0/4e9be210-c8eb-11ea-9dfb-6da8e309e0d8.png'] }).then(res=>{console.log(res)}).catch(err=>{console.log(err)})
在服务端进行云空间中文件删除
00 -
慕村6345035
2020-07-18
这个api是在云函数使用的,而且现在阿里云的客户端不支持删除文件!
00 -
Bug制造专家
2020-07-18
问题+1
00
相似问题