0



I am still working on a problem to get a html download button that can download a picture like this one:

https://instagram.fhrk1-1.fna.fbcdn.net/v/t51.2885-19/59381178_2348911458724961_5863612957363011584_n.jpg?_nc_ht=instagram.fhrk1-1.fna.fbcdn.net&_nc_ohc=tBa1BvKa4J8AX_ood-9&oh=f1a9a51e56f995f41cb7c3175e83cd53&oe=5E8E1D25

I have tried it with a normal w3 html button like this:

<!DOCTYPE html>
<html>
<body>

<p>Click on the w3schools logo to download the image:<p>

<a href="https://instagram.fhrk1-1.fna.fbcdn.net/v/t51.2885-19/59381178_2348911458724961_5863612957363011584_n.jpg?_nc_ht=instagram.fhrk1-1.fna.fbcdn.net&_nc_ohc=tBa1BvKa4J8AX_ood-9&oh=f1a9a51e56f995f41cb7c3175e83cd53&oe=5E8E1D25" download>
  <img src="https://instagram.fhrk1-1.fna.fbcdn.net/v/t51.2885-19/59381178_2348911458724961_5863612957363011584_n.jpg?_nc_ht=instagram.fhrk1-1.fna.fbcdn.net&_nc_ohc=tBa1BvKa4J8AX_ood-9&oh=f1a9a51e56f995f41cb7c3175e83cd53&oe=5E8E1D25" alt="W3Schools" width="104" height="142">
</a>

<p><b>Note:</b> The download attribute is not supported in Edge version 12, IE, Safari 10 (and earlier), or Opera version 12 (and earlier).</p>


</body>
</html>

In my case its not working. I think thats only a way of downloading something whats locally saved. I don´t want to save it local to get it downloaded by a user.

Thank you

Libra
  • 2,544
  • 1
  • 8
  • 24
  • 1
    Does this answer your question? [href image link download on click](https://stackoverflow.com/questions/2408146/href-image-link-download-on-click) – Libra Jan 07 '20 at 18:36

1 Answers1

0

You should set the image path in the download attribute. Like this:

<a href="image.png" download="image.png">
   <img src="image.png" alt="W3Schools" width="104" height="142">
</a>
Niv Apo
  • 983
  • 1
  • 9
  • 18