Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Basically, how does Amazon S3 handle files which already have the same filename inside a specified bucket? Assuming I can only upload to one particular bucket, will S3 change the filename or something?


share|improve this question

migrated from Oct 9 '12 at 7:38

This question came from our site for professional and enthusiast programmers.

up vote 3 down vote accepted

No, if the name is the same, you will just overwrite the file. That is why it is best to prefix the files so that they have unique names/ paths

share|improve this answer
Thanks for that answer! :) – Nikko May 25 '10 at 9:00

Most uploads to S3 use 'filenames' which are what Amazon S3 calls keys that look like paths to 'normal people' EG: Documents/important/project1/somefile.txt

If you pass the same key to upload a file, it is replaced, unless versioning is on.

S3 supports versioning. This means that when you upload to the same key twice, two versions of the file are stored. Note that if you upload the exact same file twice, you get to pay for two identical copies of the same file on S3. So you need to be careful uploading the same file to S3 many times in a row with versioning on.

To use versioning, you need to turn it on for your S3 bucket.

Also, for small files, the actual cost of a PUT statement needs to be taken into account: it not only costs $0.15 /GB + small overhead per file, but it also costs $1.00 to upload 100,000 files to S3.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.