Win a copy of Murach's Python Programming this week in the Jython/Python forum!
    Bookmark Topic Watch Topic
  • New Topic

file download !  RSS feed

 
subodh varshney
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Report post to moderator
PrintWriter out1 = response.getWriter();
response.setContentType("application/octet-stream");
response.addDateHeader("Expires", 1);
response.setHeader("Content-Disposition","attachment;filename="+pagename);
out1.write(contents.substring(0,contents.length()).trim());


I m using above code it is working, but when i download file it includes some extra lines(whitespaces) in the haeder of the file
 
Bauke Scholtz
Ranch Hand
Posts: 2458
 
Amit Ghorpade
Bartender
Posts: 2856
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Report post to moderator

Closed.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!