【发布时间】:2021-04-05 10:40:42
【问题描述】:
我正在尝试从 AWS s3 中删除一个文件。我没有那个文件的密钥。相反,我有该文件的完整路径 URL。 喜欢:https://atlms.s3.ap-south-1.amazonaws.com/folder/606ae1d032b0e7asdfkjh.image
我可以这样删除文件吗:
const fileParams: S3.Types.PutObjectRequest = {
Bucket: bucketPath,
Key: key //here I have only the URL to the file
}
s3.deleteObject(fileParams, function (error) {
console.log(error);
})
【问题讨论】:
标签: javascript node.js amazon-s3 amazon-iam