As of this post, all major desktop browsers excluding Microsoft IE support the download attribute. 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. If you have no other alternatives to force the file to download, you can host it on a file hosting service such as Google Docs.
We just launched W3Schools videos. 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.
Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 8 years, 9 months ago. Active 8 years, 9 months ago. Viewed 1k times. Pepi San Pepi San 93 1 1 silver badge 10 10 bronze badges. Add a comment. Active Oldest Votes.
0コメント