jQuery in Action, 3rd edition
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 Introducing JavaFX 8 Programming this week in the JavaFX 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 + "\"");
java.io.FileInputStream fileInputStream =
new java.io.FileInputStream(filepath
+ filename);
int i;
while ((i=fileInputStream.read()) != -1) {
I agree. Here's the link: http://aspose.com/file-tools
subject: file download
It's not a secret anymore!