wood burning stoves
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 REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "File download" Watch "File download" New topic

File download

kausalya mohan

Joined: Aug 02, 2007
Posts: 1
Hi all,

I tried the following code to download a file.
String fileName = "abc.xml";
response.setHeader("Content-Disposition", "attachment;filename=" + fileName);

But when I execute this I get the file dialog,but when I click on the open button I get "Action cancelled".But I want to download the file.Can anybody help?

It is sorta covered in the JavaRanch Style Guide.
subject: File download
It's not a secret anymore!