href image link download on click
<a download="custom-filename.jpg" href="/path/to/image" title="ImageName">
<img alt="ImageName" src="/path/to/image">
</a>
It's not yet fully supported caniuse, but you can use with modernizr (under Non-core detects) to check the support of the browser.
Force Browser to download Image with Javascript window.open?
Use application/octet-stream instead of image/jpg:
If [the Content-Disposition] header is used in a response with the application/octet-stream content-type, the implied suggestion is that the user agent should not display the response, but directly enter a `save response as...' dialog.
— RFC 2616 – 19.5.1 Content-Disposition
Related Topics
How to Loop Through Json Array and Get Specific Values
Print Function Not Working in Chrome
How to Save .Xlsx Data to File as a Blob
How to Output a Pdf Buffer to Browser Using Nodejs
How to Replace Double/Multiple Slash to Single in Url
How to Show Roles of User Discord.Js/Userinfo Command
How to Find Object in a List of Items by Index Using Es6 (Reactjs)
How to Partition Input Field to Appear as Separate Input Fields on Screen
How to Wait for One Function to Finish Before Continuing
Check If Json Response Data Is Empty
Change Button Color When Click on the Button
Prevent React-Router History.Push from Reloading Current Route
Display Images in React Using Jsx Without Import
React-Router Urls Don't Work When Refreshing or Writing Manually
Javascript Check If Values Exist in Array Json
Javascript - Adding White Space to Left of String
Detect If User Is Using Webview for Android/Ios or a Regular Browser
Disable/Hide Download Button in Iframe on Default Pdf Viewer