• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setting file name for creating a data file via servlet

 
steve lopez
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have created a Servlet/JSP solution that allows the user to save data from MySQL as tab-delimited file.
What I do not know is how to programmatically set the default name for the file when the user does a 'Save As'. I recall seeing a solution to this awhile back but cannot find the reference.
Thanks!
Steve
 
steve lopez
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please disregard! I just found my answer in a previous post (guess I didn't search thoroughly enough the first time).
The answer is:
response.setHeader("Content-Disposition","attachment;filename="ALLRESULT.CSV");
Thanks,
Steve
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, thank you for getting back to us so that it doesn't waste anyone's time and provides an answer for others looking for it

Dave
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic