Joshua
Joshua

Reputation: 1994

How to provide unique name for Amazon S3 object?

I am using Amazon S3 as image hosting and need to upload images keeping their name unique in order to avoid duplications.

I am using the following iOS code:

// Following code is iOS but it's really make no difference.  
S3PutObjectRequest *por = [[[S3PutObjectRequest alloc] initWithKey:MYKEY inBucket:MYBUCKET] autorelease];

What is the best way to ensure that MYKEY is unique?

The key name has really no importance for me and could be pure random string.

Upvotes: 2

Views: 875

Answers (1)

Related Questions