dcsimg
File download from servlet
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   vineet_mittal
Posted On:   Monday, April 23, 2001 11:27 PM

I want to have a servlet which will get data from database and write it to a new file on the client machine. It would be great if servlet can also ask user for the path in which to save file. I am working on Win NT and using JWS. Any alternative approach is also welcome.

Re: File download from servlet

Posted By:   Leonard_Tambunan  
Posted On:   Saturday, April 28, 2001 04:37 AM

1. Get binary stream from the db

2. Set the response contentype "text/nothing"
3. Streaming out the binary. The browser will never uderstand "text/nothing" contenttype, so it will ask client to save the file.
About | Sitemap | Contact