Categories
HTML

How to force browser to download image files on click with HTML?

Spread the love

To force browser to download image files on click with HTML, we add the download attribute.

For instance, we write

<a href="/path/to/image.png" download> download </a>

to add the download attribute to make the image at the path download instead of opening it.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *