Lessons from Creating the Unsplash Image Resizer: Simplifying Image Downloads with HTML's Download Attribute
- Categories:
- notes
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.
- Tags:
- #html
Recent Posts
Broken Pipe Error
My note about Broken Pipe error
Shell Script First
In this blog post, I'll explain why I prioritize shell scripting as my primary solution for automating tasks, and only turn to full-fledged programming languages like Ruby and Python when necessary.
Lessons from Creating the Unsplash Image Resizer: Simplifying Image Downloads with HTML's Download Attribute
How I discovered the download attribute and used it to improve image downloads
C# - The Difference Between string[] and List
Learn the difference between string[] and List
in C# and when to use each for storing collections of strings in your code Output Redirection - Standard Input, Standard Output, Standard Error, /dev/null
Penjelasan singkat mengenai shell piping dan /dev/null