S
S
Snowindy2011-01-03 16:47:22
Java
Snowindy, 2011-01-03 16:47:22

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

4 answer(s)
1
1nd1go, 2011-01-03
@1nd1go

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

C
codecity, 2011-01-03
@codecity

If it is supposed to differentiate access rights, then unambiguously store in the database.

V
vicode, 2011-01-03
@vicod

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.

1
1nd1go, 2011-01-04
@1nd1go

Well, if you have a lot of files, then dump them into special services like aws.amazon.com/s3/ or GAE (there is also an API for manipulating pictures)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question