Answer the question
In order to leave comments, you need to log in
JEE user file management?
What is the industry practice for managing user uploaded files in a web application written in the Java technology stack?
In PHP, it is customary, for example, to drop user files “under their feetâ€, into application subdirectories.
At the same time, the JEE architecture prevents this practice (focusing on further growth in storage volumes, etc.).
But I still do not understand what is being promoted in return? How to save and get a userpic without inventing your bike?
Answer the question
In order to leave comments, you need to log in
save and store the picture on the disk, not in the database, otherwise you will lose on the return. And give it through either a default servlet, which is made specifically for serving statics (puts down the correct headers, etc.), or even better through a proxy http server (apache, ngnix, lighthttpd).
Those. save to the folder where you can configure urls like yourserver/userpics/...jpg
If it is supposed to differentiate access rights, then unambiguously store in the database.
I think files should be stored on the file system, not in the database. You need to store the path to the files in the database, and only then figure out whether to issue the path to the file or not, depending on the access rights. Although if only userpics, then it is possible in the database. It is clear that the choice of solution depends on the volume of data that you are going to save.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question