How to set name of file downloaded from browser? Ask Question. Asked 11 years, 5 months ago. Active 3 months ago. Viewed 95k times. Improve this question. Sparafusile Sparafusile 4, 6 6 gold badges 34 34 silver badges 53 53 bronze badges. Add a comment. Active Oldest Votes. That's what I did, when I created a xlsx file and the browser want to save it as zip file. Improve this answer. Emile Bergeron Mephiztopheles Mephiztopheles 1, 11 11 silver badges 25 25 bronze badges. There are several ways to avoid that, you can always download the file using curl or wget to a server, rename it using rename thefileIdownloaded.
Toby Allen Palantir Palantir 23k 9 9 gold badges 74 74 silver badges 84 84 bronze badges. Thanks for that. It is likely that people who use these browsers would likely rather view the document rather than saving it to their phone. New to HTML 5. This markup is easier to understand and is supported by all modern browsers, but may not be supported by all content management systems. If for whatever reason, you cannot add the download attribute in the case that you cannot directly edit the HTML of your web page , you can optionally compress the file using zip, and instruct the user to download the zip file.
You can alternatively explain to the user that they should right click on the link and select download. Report Error. Your message has been sent to W3Schools. W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. Get certified by completing a course today! If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:.
Example Specify a value for the download attribute, which will be the new filename of the downloaded file "w3logo. Report Error.
0コメント