User-downloadable files face a significant UX problem: many have auto-generated, cryptic filenames that are difficult to read, and browsers often open linked files such as PDFs in a new tab, rather than downloading them. This is problematic: if you provide a button that says “Download X”, it’s reasonable to assume that the browser will download it, not open it.
Traditionally, these issues have been solved with complex server-side configuration and JavaScript foolery; today, you can use a little-known HTML5 attribute called download
to address both problems.