mardi 10 mars 2020

How can I deal with the file which users upload?

If I have a website, and every user can upload his or her file, after I get this file, how can I deal with this file.

Should I store it to a specific folder(like upload), and store the file path in a specific database(for example table upload_file)?

Or should I just store this file in the database, if I can, how can I apply this to reality??

I think the first way is much better, but can I store all upload files in the same folder, or should I make a folder for each user?

Maybe I can encrypt the file name with md5 or anothers? I do not know in real website development, how can you deal with the file, and keep the relationship with the user?

Thanks for your help !!




Aucun commentaire:

Enregistrer un commentaire