Archived Forum Post

Index of archived forum posts

Question:

Feature request: HTTP S3 Delete folder via wildcard/delimiter path

May 20 '17 at 22:28

Hi - can I please request a method for the HTTP component, to delete multiple objects in an S3 'folder' based on a delimiter path wildcard. (I realise you have S3_DeleteMultipleObjects, but it requires knowledge of the filenames)


Answer

I'm sorry to say it's not something Chilkat can do because of the size and complexity of the operation.

For example, to iterate over all of the objects in a 'folder' could require many request/responses to get the folder listings, given that there's a max number of items returned in any given request. Then it would require (potentially) many requests to delete the matching objects.

It's better that Chilkat provides the lower-level primitives, and a task like this should be written as a function in the application.


Answer

I'm not sure that's correct. The S3 API provides a method to return a list the contents of a "folder" in a single request, using prefix / delimiter strings. Once that's passed back, we can just iterate delete each key. I've used a similar process with a different component from nSoftware.

AWS S3 ListKeys Doc: http://docs.aws.amazon.com/AmazonS3/latest/dev/ListingKeysHierarchy.html