wood burning stoves 2.0*
The moose likes Servlets and the fly likes How to use File download using CommonsFile API Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to use File download using CommonsFile API" Watch "How to use File download using CommonsFile API" New topic
Author

How to use File download using CommonsFile API

surendar prabu
Ranch Hand

Joined: Jul 24, 2006
Posts: 102
I have used CommonsFile to upload a file to my server and write the BLOB into the database. When i retrieve the Blob from the database how can i provide it for the user to download as file. Should i write it to a File before i send it to the client. or can i send the Input/Output stream directly to the client by setting the appropriate response type? I am not able to get wat to do. Help me on this regard

Regards
Surendarprabu


SCJP 1.4
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

I don't see the point in writing to file on the webserver.
I would try streaming it right to the browser.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
jQuery in Action, 2nd edition
 
subject: How to use File download using CommonsFile API