Author
HTTP Header question
Shane Burgel
Ranch Hand
Joined: Sep 09, 2003
Posts: 47
posted May 13, 2004 07:41:00
0
Is there a header that can specify the file name? I have a file with the following headers: Content-Type=application/download Content-Disposition=attachment but I also want to specify the filename dynamically for the file when it is downloaded so I need a header that I can use to set the file name. Thanks for your help
Balaji Loganathan
author and deputy
Bartender
Joined: Jul 13, 2001
Posts: 3150
posted May 13, 2004 07:44:00
0
Shane!.. This is servlet realted question, i'm moving this to servlet forum.
Lasse Koskela
author
Sheriff
Joined: Jan 23, 2002
Posts: 11962
posted May 13, 2004 08:15:00
0
Try "Content-disposition: attachment; filename=MyFile.txt"
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog ] [HowToAskQuestionsOnJavaRanch ]
Shane Burgel
Ranch Hand
Joined: Sep 09, 2003
Posts: 47
posted May 13, 2004 08:31:00
0
Thanks that worked but that begs another question. Is there a way to specify the download location for the file? Is there a way I can specify a header to say that the default download directory should be say C:\Temp ? [ May 13, 2004: Message edited by: Shane Burgel ]
David O'Meara
Rancher
Joined: Mar 06, 2001
Posts: 13459
posted May 13, 2004 20:25:00
0
To prevent duplicate conversations, this thread is continued here . I'll close this copy. Dave.
subject: HTTP Header question