0

I'm uploading images to S3 using their API and putObject.

When I upload an image which has the same key as an object already in the bucket, the original object is overwritten.

Is there away around this?

I've checked SO but it's quite an old question now, are there any newer/better methods?

Community
  • 1
  • 1
panthro
  • 22,779
  • 66
  • 183
  • 324

1 Answers1

0

S3 is designed to allow you to do overwrites in this way. However, if you are using the AWS SDK for PHP, you could use the doesObjectExist method prior to using putObject, if you wanted to check for the existence of an object before you upload it.

Jeremy Lindblom
  • 6,437
  • 27
  • 30