如何使用knox删除S3 Bucket中的文件?

时间:2022-09-28 10:47:47

I need to remove a file in S3 Bucket with Knox library.

我需要删除带有Knox库的S3 Bucket中的文件。

I found some examples that explain how to upload a file but I was not able to find any examples that explain how to remove a file.

我找到了一些解释如何上传文件的示例,但我找不到任何解释如何删除文件的示例。

Can you provide me with an example code?

你能给我一个示例代码吗?

Thanks.

谢谢。

1 个解决方案

#1


1  

Here is a sample code. More reference you can refer KNOX

这是一个示例代码。更多参考,你可以参考KNOX

client.del('/test/Readme.md').on('response', function(res){
  console.log(res.statusCode);
  console.log(res.headers);
}).end();

#1


1  

Here is a sample code. More reference you can refer KNOX

这是一个示例代码。更多参考,你可以参考KNOX

client.del('/test/Readme.md').on('response', function(res){
  console.log(res.statusCode);
  console.log(res.headers);
}).end();