views:

31

answers:

2

Hi!

What do you suggest for location of images that the user uploads to my application?

in my server application (like WebContent->images) or in system location?

+2  A: 

Store it outside the Tomcat installation. That makes updates of both Tomcat and your application a lot easier.

You could also think about storing the images as BLOB in a database.

Olvagor
+1  A: 

You can map an external directory outside Tomcat within server.xml to store the images.

Use the <Context docBase="/some_path_on_your_machine"> tag for this.

If you use a database, it is recommended to store the path to the image in the database, and the actual image on filesystem.

See this thread http://stackoverflow.com/questions/348363/what-is-the-best-practice-for-storing-uploaded-images

JoseK