For saving attachments use a hash its the best.
Save it on s3 usually the best for me.
save the url to file in a database.
You can have a field to mark the active version .
Hi guys, for a very large project the users must have the ability to save attachments. These attachments can be images but they can also be documents like Word, Docx, PDF et cetera.
My question now:
What is the best way to save files e.g. upload to FTP but add a prefix to the file names for example:
avatar.png becomes _avatar.png
Or would it be better to hash the filenames and store the original name with a pointer to the hashed name (2 tables) so you get ugly names like:
avatar.png becomes hjdfuhns34tgds833dfs2.png.
I hope you guys can give me some tips on what you think is the best method to do such a thing.
Keep in mind that we also need to know if someone overwrites a file, or uploads a "newer version" of the file when the name is the same.
Best regards
Please or to participate in this conversation.