As a Software Engineer, I’m always looking for ways to make my workflow more efficient and productive. One tool that I recently created is the Unsplash Image Resizer.

When I first started working on this tool, I discovered the HTML download attribute for the a tag.

The download attribute allows users to download a file directly from the browser instead of opening it in a new tab or window. It’s incredibly useful for things like images, PDFs, and other downloadable files.

To use the download attribute, all you have to do is add it to the a tag in your HTML code, along with the filename that you want to give the downloaded file. For example:

<a href="image.jpg" download="myexampleimage.jpg">Download Image</a>

In this code, “image.jpg” is the URL of the image that you want to download, and “myexampleimage.jpg” is the filename that will be used for the downloaded file. When the user clicks on the link, the file will be downloaded directly to their computer with the specified filename.

Note that If you’re experiencing an issue where the browser is opening the image instead of downloading it, it’s possible that the browser you’re using doesn’t support the download attribute for image files.