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:
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
How to Defend Against Brute-Force and DoS Attacks with Fail2ban, Nginx limit_req, and iptables
In this tutorial, I’ll explain how to protect your public-facing Linux server and Nginx web server from common threats, including brute-force and DoS attacks.
Is Getting AWS Solutions Architect Associate Certification Worth It?
If you are a full-time Software Engineer, there's no strong need to pursue this certification.
DevSecOps
My Notes about DevSecOps
AWS Secrets Manager
Explanation about AWS Secrets Manager with example code.
Envelope Encryption
Envelope encryption is the practice of encrypting plaintext data with a data key, and then encrypting the data key under another key.