This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSF and the fly likes save image in database or in server directory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "save image in database or in server directory" Watch "save image in database or in server directory" New topic
Author

save image in database or in server directory

simon tifo
Greenhorn

Joined: Mar 19, 2013
Posts: 2
I have a field image in my product table and class and I 'd like to ask you which is better : save the image in the database or in one directory in the server

if the second case is the best, please explain me more how to manage it (I never had the opportunity to meet this case)
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15959
    
  19

People argue over that. It depends on a lot of things. There's no "right or wrong", just what works best for you.

When you upload an (image) file, the data is stored in the server in a local cache where it can be accessed as an input stream. Your application code can then copy the data stream to a database BLOB or it can create a file on the server's filesystem and copy the data into that file. The file can be located anywhere you wish, as long as you don't copy it into your WAR's directories or into the webapp server's directories.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: save image in database or in server directory
 
Similar Threads
How to get the path of an Uploaded file?
applet communicating with host server
servlets and images???
Keeping an image in database
Writing Image from Applet