File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes file download Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "file download" Watch "file download" New topic

file download

Indrayani Bhoir

Joined: Dec 02, 2002
Posts: 21
Hi ,
i want to know that is there any way to provide file download option using jsp .
currently i am using follwing code for file download option but as this don't allow any java
script to be used in same page. i am facing some problem.
// fetch the file
String filename = "companySecret.txt";
String filepath = "C:\\";
"attachment; filename=\""
+ filename + "\""); fileInputStream =
+ filename);
int i;
while (( != -1) {
It is sorta covered in the JavaRanch Style Guide.
subject: file download
Similar Threads
How to display pdf file in broswer
Splitting a zip file and rejoining it
Unable to upload file
File Downloading in IE6
Trying to use JSP to force file download..