Skip to content

Deleting all objects from bucket fails #257

Answered by rcoh
Jasperav asked this question in Q&A
Discussion options

You must be logged in to vote

From the docs, it seems like DeleteObjects doesn't work like that:

This action enables you to delete multiple objects from a bucket using a single HTTP request. If you know the object keys that you want to delete, then this action provides a suitable alternative to sending individual delete requests, reducing per-request overhead.

Looking at other examples, it seems like the best option is to use list_objects() first. There's an example in the docs that uses the Java SDK (pop open "Using the AWS SDK for Java")

https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjects.html

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by rcoh
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants