Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

automatic redirect after file download

Status
Not open for further replies.

anchal

Programmer
Sep 4, 2001
11
US
Hi,
Please refer to the code below:
Code:
response.setContentType ("application/xml"); 
response.setHeader ("Content-Disposition", "attachment; filename=\"my.xml\"");

java.io.BufferedReader in = new java.io.BufferedReader(new java.io.FileReader(xmlPath));
String s = null;
while((s = in.readLine()) != null) {
    out.write(s);
}
This code is part of a jsp that is invoked when I click a link on a page in the browser to download an xml file.
The download works fine. But I also want
1. the page to get refreshed after the download is complete.
2. when I click 'cancel' button on the 'file download' dialog box, I want to get redirected to a servlet.
How can I go about achieving this?
Thanks in advance,
Anchal.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top