Hi all

I have been searching the net, discussion groups, usenet and more for an
answer to the following:

I'm building a JSP application, where you can attach documents to cases.
I've written a bean which uploads the file to the underlying Oracle
database. This is done through jdbc and a form post. I filter out the
boundary, filename, content-type, etc, and insert the data, filename and
content-type into the database using the setBinaryStream-method. This workes
quite well.
But now I want the users to be able to download these files again. Whenever
I try to write the data to the outputstream, after having set the proper
content-type, length, etc. the browser thinks I'm sending the entire
jsp-file, with the filedata included. I've tried stripping the jsp-file, so
that only the data should be in it, but still it adds a few empty lines
before and after the data.
I've gone around the problem by saving the file to the webserver, and then
redirecting the browser to the file-location using javascript. This works
fine, and looks a lot like when you download from download.com and others.
I'm looking for a way however to stream the data directly to the browser.
Can this be done, and how? Can you get a new outputstream just for the file,
or what could be done?

Thank you,

Christian Holm

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to