• Post Reply Bookmark Topic Watch Topic
  • New Topic

download file name changing  RSS feed

 
Skip Cole
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm trying to download a file via a servlet. Everything works fine, but the name of the file gets changed during the download.
I have included the following 2 lines in the servlet, so I am not sure why this is happening.
response.setContentType("text/plain");
response.setHeader("Content-Disposition", "attachment;fileName=ur.txt");
Any help will be greatly appreciated,
Skip
 
Tim Holloway
Bartender
Posts: 18715
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does it get changed to?
BTW, Content-Disposition doesn't work (or sometimes doesn't work correctly) depending on the browser brand and version. Had to put that in 'cause I'm getting tired of websites assuming that I'm running IE5.5 under Windows!
 
Skip Cole
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It gives it the name of the jsp that initially called the servlet to perform the download.
Weird.
Skip
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!