This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

java servlet  RSS feed

 
Chanpreet, Julka
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I have this java servlet that gets a GZip file and sends it to the response, so then anyone can download it form a browser. The problem is that when you download the file, the file name is not the name of the GZip file i am sending. It is the name of the Java Servlet i am running. How do you set the specific name of the file through the Servlet? I know there is someway but i just cant figure it out. Thanks.
 
Mahesh Rana
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
response.setHeader("Content-Disposition","attachment;filename=" + "whatever.name");
-----------------------------
Enjoy
-----------------------------
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!