Why is this not working:
download.html
<a href="jsplogin.jar">download</a>
The jsplogin.jar
file is in the same folder has the download.html
file.
when I click the download link the file jsplogin.jar
should download but its trying to open the file in the browser. when I right clicked on the link and selected "save link" nothing is happening.
Approach 1: Using Download attribute The download attribute simply uses an anchor tag to prepare the location of the file that needs to be downloaded. The name of the file can be set using the attribute value name, if not provided then the original filename will be used.
Explains the way to use the anchor tag with download attribute to force a file download. HTML5 introduced the download attribute of the anchor tag to add downloadable behavior to it. We can use the anchor tag to download a file by specifying the name of the downloadable file.
You can also right-click anywhere on the page and select Save as or use the keyboard shortcut Ctrl + S in Windows or Command + S in macOS. Chrome can save the complete web page, including text and media assets, or just the HTML text.
In HTML5, in most browsers you can add a 'download' attribute to the a
element.
for example:
<a href="http://www.example.com/index.html" download>Download</a>
Based on this question. How can I create download link in html?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With