Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript 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
-----------------------------
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!