It's not a secret anymore!
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

download problem

vijay akni kumar

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);
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:
subject: download problem
It's not a secret anymore!