How to create a folder on Amazon S3 using objective-c

I know this is a question that may have been asked before ( at least in Python ), but I'm still trying to get this right. I am comparing my local folder structure and content to what I saved in my Amazon S3 carpet. Directories not located on S3 but locally must be created in my S3 bucket. It looks like Amazon S3 does not have the concept of a folder , but rather the folder is identified as an empty file of size 0. My question is: how can I easily create a folder in objective-c by placing an empty file (with a name corresponding to the name of the folder) on S3 (I use ASIHTTP for my get and put events)? I want to create a directory explicitly and implicitly by copying a new file to a non-existing folder. I appreciate your help with this.

+1
source share
1 answer

Amazon S3 doesn't seem to have a folder concept, but rather the folder is identified as an empty file of size 0

The / character is often used as a delimiter when keys are used as paths. To create a folder named bar in the parent folder foo , create a key named /foo/bar/ .

Amazon now has an AWS SDK for Objective-C . The S3PutObjectRequest class has the -initWithKey:inBucket: method.

+7
source

Source: https://habr.com/ru/post/1383620/


All Articles