Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

download problem

vijay akni kumar
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic