Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
174
rated 0 times [  177] [ 3]  / answers: 1 / hits: 58588  / 12 Years ago, fri, april 6, 2012, 12:00:00

If a user clicks on a downloadable link such as



<a href=downloadable.txt>Download</a>


Is there a client-side (html or javascript) way to change the name of the file before the 'Save As' dialog?


More From » html

 Answers
41

No, you cannot change this from the client side (HTML or javascript). You need to change it from the server. One way is to use a server side script which will set the Content-Disposition HTTP response header:



Content-Disposition: attachment; filename=somecustomname.txt

[#86382] Thursday, April 5, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ravenl

Total Points: 338
Total Questions: 107
Total Answers: 112

Location: Belize
Member since Mon, Jun 20, 2022
2 Years ago
ravenl questions
Thu, Feb 18, 21, 00:00, 3 Years ago
Tue, Jan 12, 21, 00:00, 3 Years ago
Tue, Mar 17, 20, 00:00, 4 Years ago
;