Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to Dwonload a file using JSP?

 
Kalpesh Desai
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Sir/Madam,
I'm doing a Upload/DownLoad file functionality using JSP.
I used the com.oreilly.servlet.MultiPArtRequest class to upload the file on the Server.But I don't know how to download this file using JSP.
A simple solution to this to open the file in the Browser or run an application separately on the client machine to open the file.This option works with IE but this doesn't work with Netscape Navigator.
Next option is to store the file as BLOB object in database while Upload and use the OutputStream class to read this object while Download.But i have a restrictions on use of BLOB,thus can't use it.
Other solution for this is to use the OutputStream class to download the file directly from server.But I don't know how to use it in the JSP to download a file at the client using OutputStream.
Can anybody help me on this with a sample code.
Thanks and Regards,
Kalpesh
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic