How to delete a file with an empty name from S3

大兔子大兔子 提交于 2020-08-27 09:00:08

问题


Somehow, using the AWS Java API, we managed to upload a file to S3 without a name.

The file is shown if we run s3cmd ls s3://myBucket/MyFolder, but is not shown in the S3 GUI.

Running s3cmd del s3://myBucket/MyFolder/ give the following error:

ERROR: Parameter problem: Expecting S3 URI with a filename or --recursive: s3://myBucket/MyFolder/

Running the same command without the trailing slash does nothing.

How can the file be deleted?


回答1:


As far as I know, it can't be done using s3cmd.

It can be done using the aws cli, by running:

aws s3 rm 3://myBucket/MyFolder/

Make sure you don't use the --recursive flag, or it will remove the entire directory.



来源:https://stackoverflow.com/questions/33753269/how-to-delete-a-file-with-an-empty-name-from-s3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!