I would like to download an HTML file, let's say test1.pdf. Here's what I have right now:
<a href="https://-----/test1.pdf" download>download </a>
How can I make it so that it can download as test2.pdf?
I would like to download an HTML file, let's say test1.pdf. Here's what I have right now:
<a href="https://-----/test1.pdf" download>download </a>
How can I make it so that it can download as test2.pdf?
You can suggest a filename for the browser to use when saving the file in the value of the download
attribute.
<a href="https://-----/test1.pdf" download="test2.pdf">download </a>
Try something like this. The download load attribute specify its a download and not a link.
https://www.w3schools.com/tags/att_a_download.asp
<a href="/images/myw3schoolsimage.jpg" download="w3logo">
<a href="https://-----/test1.pdf" download="test2.pdf">download </a>
That's all you have to do.