Using the HTML5
You can use the
download to instruct the browser to download the requested URL rather than navigating to it.
Here is an example:
<a href="book.pdf" download>Download the file</a>
You can also provide a value for the
download attribute that will be used as the file name. If the value is not provided, the filename is used:
<a href="book.pdf" download="yourbook.pdf">Download file</a>
As was just demonstrated, the
- Author: Ahmed Bouchefra Follow @ahmedbouchefra
✋If you have any questions about this article, ask them in our GitHub Discussions 👈 community. You can also
❤️ Like our page and subscribe to our feed for updates!
Find a list of emojis to copy and paste