• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

download problem

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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);
out.flush();
out.close();
can any one tell me how to solve this problem is here any problem with headers that iam setting.
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic