Prevent duplicate storage on S3

2.2k Views Asked by At

How does one prevent storing a duplicate value on S3 based on the MD5 hash? It seems the only way is to run the hash before trying to store the file, but is there a way to ask S3 to not store the file if its the same as the last version of the file. I don't even want S3 to record a new version.

1

There are 1 best solutions below

1
On

Name the file with the hash. This way when you try to upload a duplicate you can check to see if the duplicate exists first before uploading.