jQuery in Action, 3rd edition
The moose likes Servlets and the fly likes Upload-Download Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Upload-Download" Watch "Upload-Download" New topic


Ashish Malik
Ranch Hand

Joined: Jul 11, 2010
Posts: 50
I want to upload an image to my DB.
I am using servlet to upload and hibernate to store.
Everything is working fine but when i download image it doesn't show the image, although the file gets created as it is.

I tried saving it to some location immediately after uploading but same problem.

Here's my code snippet from servlet...

elvadas nono

Joined: Jul 04, 2011
Posts: 12
in the download servlet do not forget contentType
Bhardwaj kapoor

Joined: Aug 06, 2011
Posts: 1
Yes if you do not specify the content type then how it will show the results because it is not getting the proper command to show the results exactly in which format.

Nurse Assistant | Certified Medical Assistant | Is Clinical Youth Complex
I agree. Here's the link: http://aspose.com/file-tools
subject: Upload-Download
It's not a secret anymore!