Skip to Content
Platform.Ontology

Trigger file downloads

Saves a file to the device; repeated automatic downloads ask permission.

Does something on your deviceThings a page can doFilesWeb browsersWhile you use it

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

Chromeworks
Edgeworks
Firefoxworks
Safariworks
iPhoneworks
Androidworks
Samsungworks
BrowserStatusFirst versionReleasedNote
ChromeSupported142011-09-16None
EdgeSupported182018-10-02None
FirefoxSupported202013-04-02None
SafariSupported10.12017-03-27None
Safari on iPhoneSupported132019-09-19All iOS browsers use WebKit
Chrome on AndroidSupported182012-06-27None
Samsung InternetSupported1.02013-04-27None

How a site asks for it

API<a download href=blob:...>; Content-Disposition: attachment; fetch+Blob
Browser compat keyshtml.elements.a.download
api.HTMLAnchorElement.download
How access is grantednone
What the user seesNone (no browser prompt)
Needs a secure context (HTTPS)No
Needs a user gestureNo
Activationnone
How long it lastsChrome stores Automatic downloads permission per origin after the person allows it
How to take it backNothing to revoke (no permission is stored)
Inside an iframeSandboxed frames need allow-downloads (Chrome 83); downloads from cross-origin iframes without activation are blocked

Typical flow

  1. Page creates anchor or sends Content-Disposition
  2. Browser starts download
  3. 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

TypeExampleApps
productivityYou hit Export on a spreadsheet web app and it makes the CSV file right inside your browser.Google Sheets, Airtable
creativeA design tool saves your finished artwork as a PNG or PDF straight from the page.Figma, Canva
bankingYour bank offers a statement as a PDF download for your tax records.None named
gamesA browser game lets you download your save file so you can move it to another computer.None named
securityA malicious site tries to push a file you did not ask for, which is why browsers warn on repeated automatic downloads.None named
videoA 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

ScoreValueMeaning
Sensitivity2 of 5How revealing the data is
Utility4 of 5How useful it is to honest apps
Friction0 of 5How much the user has to do
Fingerprint bitsNot ratedRough 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)

Sources

How well checked: Based on official documentation.

On this page