Trigger file downloads
Saves a file to the device; repeated automatic downloads ask permission.
In one line
Can save a file to your device, but repeated automatic downloads ask first
Saves a file to the device; repeated automatic downloads ask permission.
A site can drop files into Downloads (reports, exports, installers). Browsers guard with multi-download prompts and safe browsing checks because a downloaded file is how malware arrives.
What it can and can't do
What the user does: Nothing for the first one. It happens when the page runs a download or you tap a link.
It can
- Save a file to your Downloads folder when you tap a download link
- Make a file on the spot, such as a receipt or a report, and save it
- Start one download without asking in most browsers
It cannot
- Save many files in a row without a second prompt asking you to allow it
- Open or run the file for you; you still have to open it
- Save the file anywhere except the browser's download location
- Skip the browser's warning for risky file types
How it differs between platforms: Chrome, Edge and Firefox ask before several automatic downloads. Safari on iPhone shows a download button for each file.
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 14 | 2011-09-16 | None |
| Edge | Supported | 18 | 2018-10-02 | None |
| Firefox | Supported | 20 | 2013-04-02 | None |
| Safari | Supported | 10.1 | 2017-03-27 | None |
| Safari on iPhone | Supported | 13 | 2019-09-19 | All iOS browsers use WebKit |
| Chrome on Android | Supported | 18 | 2012-06-27 | None |
| Samsung Internet | Supported | 1.0 | 2013-04-27 | None |
How a site asks for it
| API | <a download href=blob:...>; Content-Disposition: attachment; fetch+Blob |
| Browser compat keys | html.elements.a.downloadapi.HTMLAnchorElement.download |
| How access is granted | none |
| What the user sees | None (no browser prompt) |
| Needs a secure context (HTTPS) | No |
| Needs a user gesture | No |
| Activation | none |
| How long it lasts | Chrome stores Automatic downloads permission per origin after the person allows it |
| How to take it back | Nothing to revoke (no permission is stored) |
| Inside an iframe | Sandboxed frames need allow-downloads (Chrome 83); downloads from cross-origin iframes without activation are blocked |
Typical flow
- Page creates anchor or sends Content-Disposition
- Browser starts download
- Safe Browsing may warn or block
Data you get
Shape: none
No individual data fields. The signal is the access itself.
Technical limits
- download attribute is ignored for cross-origin URLs (Chrome 65, Firefox); filename comes from the response then
- Second and later downloads without a click trigger Chrome's Automatic downloads prompt (Firefox shows a similar download panel)
- Chrome blocks downloads from sandboxed iframes without allow-downloads (Chrome 83) and insecure (HTTP) downloads on HTTPS pages (Chrome 86 to 88)
- Cannot choose the download folder; cannot open the file; dangerous file types get a warning
- Blob URLs and data: URIs for large files are limited by memory (Chrome about 2 GB single Blob); stream with FSA or Streams for bigger files
The story
What it is
A site can save a file to your device, and the browser asks if it keeps doing it.
For you
You click a button and a file lands in your Downloads folder. If a page tries to download many files by itself, the browser asks whether to allow that.
For makers
Makers build files in the page (a report, an image, an export) and hand them over with one click. It saves server work and lets apps feel like desktop programs.
Where you see it
| Type | Example | Apps |
|---|---|---|
| productivity | You hit Export on a spreadsheet web app and it makes the CSV file right inside your browser. | Google Sheets, Airtable |
| creative | A design tool saves your finished artwork as a PNG or PDF straight from the page. | Figma, Canva |
| banking | Your bank offers a statement as a PDF download for your tax records. | None named |
| games | A browser game lets you download your save file so you can move it to another computer. | None named |
| security | A malicious site tries to push a file you did not ask for, which is why browsers warn on repeated automatic downloads. | None named |
| video | A web video editor renders your clip and downloads the MP4 when it is done. | Clipchamp |
Risks
- Unwanted files
- Disguised malware
Good uses and abuse
Legitimate uses
- Export CSV
- Save generated files
Known abuse
- Drive-by download
- Multiple download spam
- Unwanted installers
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 2 of 5 | How revealing the data is |
| Utility | 4 of 5 | How useful it is to honest apps |
| Friction | 0 of 5 | How much the user has to do |
| Fingerprint bits | Not rated | Rough identifying entropy, when known |
History
- 2018-03, Chrome 65: download attribute ignored for cross-origin URLs
- 2020-06, Chrome 83: Downloads in sandboxed iframes need allow-downloads
- 2020-10, Chrome 86: Mixed-content downloads blocked in phases (executables first in Chrome 88)
Related capabilities
Related
- File System Access: open and save pickers. Can open files you pick and save changes back to them, in Chrome and Edge
Sources
How well checked: Based on official documentation.