fastapi-storages icon indicating copy to clipboard operation
fastapi-storages copied to clipboard

Same file name

Open Hassan-Ahmadi opened this issue 1 year ago • 1 comments

Hi,

how is the same file name supperted? as I tried it did not check if a file with the same name exists and just over writed it. can you add some mechanism to detect file exists and add some hash for example to the end of the file?

Thanks

Hassan-Ahmadi avatar Nov 14 '24 09:11 Hassan-Ahmadi

Hi Hassan. This is usually done on the backend side by the developer themselves. Your storage may be huge and inserting in that case will take a lot of time. I usually add uuid4 hashes to the end of the name or instead of the name.

VasilevArtem avatar Dec 29 '24 11:12 VasilevArtem

We do handle the files with the same name, there's a configuration to change this behaviour: OVERWRITE_EXISTING_FILES We either overwrite them or create new ones with a different suffix like _1, _2, etc.

aminalaee avatar May 22 '25 11:05 aminalaee