File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes download problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "download problem" Watch "download problem" New topic
Author

download problem

vijay akni kumar
Greenhorn

Joined: Aug 11, 2008
Posts: 12
In my application when ever i download a file i get a download manager if i say save it works fine but when ever i click on open it gives error message.
my code for download is

String fileName = rst.getString("filename");

response.setHeader("Content-Disposition","attachment; filename=\"" + fileName);
response.setDateHeader("max-age", 0);
response.setHeader("cache-control", "no-cache");
response.setHeader("Transfer-Encoding", "chunked");
response.setHeader("Transfer-Encoding", "deflate");response.setHeader("Content-Encoding", "en-US");
response.setHeader("Connection", "keep-alive");
response.setHeader("Expires", "0");
response.setHeader("Pragma", "no-cache");
OutputStream out = response.getOutputStream();
int off = 0;
int l = (int) rst.getBlob("docunemt").length();
out.write(blobdata, off, l);
out.flush();
out.close();
can any one tell me how to solve this problem is here any problem with headers that iam setting.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: download problem