Company
Date Published
Author
Ryan Roberts
Word count
341
Language
English
Hacker News points
None

Summary

Let's say, you are making a cloud and/or sharing service. It would be disappointing to find out after putting in all of that work to make the app, you can’t have your users download an image from your website. At least it was for me, so if this very specific problem has occurred for you too, this article will explain how to make images download onto the user’s computer instead of doing this.But can’t I just send the using to the file URL, wouldn't that download it for them, you ask?Nope, probably. If this was any other kind of file, then most likely. We are talking about browsers here, so I can’t talk in absolutes. It’s difficult to assume a general behavior between all browsers as they can behave different from each other.Okay, then what is probably the solution to this, you add?The addition of 'download' to the end of the href tag makes all of the difference. This allows users to download images by clicking on the link in their browser's context menu or right-clicking and selecting "Save image as." By adding this code to an HTML element, such as a button or anchor tag, you can enable file downloads in your Bubble app.