Please check the sources :
<a href="http://test.com/test.png" download="test.png">Download Image</a>
However, the download window will not appear and will be moved to the href address.
How do I force url to download from the client side?
I respect all the developers. Thank you for reading this article.
For me it works fine in Chrome 70 for me, but you could try adding target="_blank" to the link as a fallback.
I got the information and tested it from my side using this applet:
from this page:
I don't understand.
try this code
<a href="https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png" download> <img src="https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png" alt="W3Schools" width="104" height="142"> </a>
Works fine on my PC (Chrome 70). On an iPad, for example, this won’t work because iOS can’t “download” things like that. That is why I suggested adding target=“_blank” to the a element. For browsers that support downloading, nothing will change. For browsers that don’t, the image wil, open in a new tab so users can manually download the file.