Dropping files and folders onto the page
Receives files and whole folders the person drags onto the page, with no prompt.
In one line
Can receive files or whole folders you drag onto the page
Receives files and whole folders the person drags onto the page, with no prompt.
Dropping is consent for exactly what is dropped, including folder trees. The site can read file contents and, in Chrome, ask for write access to the dropped items.
What it can and can't do
What the user does: You drag files from your desktop onto the page and let go.
It can
- Receive the files and folders you drop
- Open the contents of what you dropped
- Include folders with subfolders
- Do it with no prompt
It cannot
- See the file names before you drop
- Take files without a drag and drop
- Change the original files, unless you also allow saving in Chrome
- Get them again later without another drop
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 13 | 2011-08-02 | None |
| Edge | Supported | 14 | 2016-08-02 | None |
| Firefox | Supported | 50 | 2016-11-15 | None |
| Safari | Supported | 11.1 | 2018-04-12 | None |
| Safari on iPhone | Supported | 11.3 | 2018-03-29 | 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 | drop event; dataTransfer.files; items; webkitGetAsEntry(); getAsFileSystemHandle() |
| Browser compat keys | api.DataTransferItem.webkitGetAsEntryapi.DataTransferItem.getAsFileSystemHandleapi.DataTransfer.files |
| 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 | Per drop |
| How to take it back | Nothing to revoke (no permission is stored) |
| Inside an iframe | Drops go to the document under the pointer; dropped items are same-origin readable only in that document |
Typical flow
- Person drags files from the OS
- Page handles dragover and drop
- Page reads files and walks directory entries
Data you get
Shape: none
No individual data fields. The signal is the access itself.
Technical limits
- Contents readable only inside the drop handler (protected mode otherwise)
- Dropped folders: webkitGetAsEntry returns the full tree, readEntries returns at most 100 entries per call in Chrome (loop until empty)
- getAsFileSystemHandle (Chrome 86) can request write access to the dropped file with a prompt
- Cannot start a drag from OS file locations; cannot read drag data before drop
- Dropped item paths are hidden; only names and relative paths
The story
What it is
Receives files and folders you drag onto the page, with no prompt.
For you
You drag a file from your desktop onto the page and let go. It is the act of dropping that gives the page the file. No prompt appears because you did it yourself.
For makers
It is the easiest way to add files and feels natural. Makers get fast uploads and fewer clicks. Because the drop is the consent, no extra prompt is needed.
Where you see it
| Type | Example | Apps |
|---|---|---|
| messaging | You drop a picture or document into a chat window to send it. | Slack, Discord, WhatsApp Web |
| creative | You drop a photo into a web editor to start work. | Canva, Photopea |
| productivity | You drop files into a cloud folder in your browser. | Google Drive, Dropbox |
| games | You drop a save file or custom map onto a browser game to load it. | None named |
| productivity | You drag a file onto an email to attach it. | Gmail |
| video | You drop a video onto an online converter or editor. | None named |
| developer | You drop a folder of files onto a web deploy tool. | Netlify Drop |
Risks
- Easy to drop the wrong file
- Large drag in
What the platform says
- MDN: File drag and drop. Documents how a page can accept files dragged from a computer onto it.
Good uses and abuse
Legitimate uses
- Drag and drop uploaders
- Folder imports
- Media editors
Known abuse
- Surprise folder uploads
- Fake drop zones
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 3 of 5 | How revealing the data is |
| Utility | 5 of 5 | How useful it is to honest apps |
| Friction | 1 of 5 | How much the user has to do |
| Fingerprint bits | Not rated | Rough identifying entropy, when known |
History
- 2020-10, Chrome 86: getAsFileSystemHandle on dropped items
Related capabilities
Related
- Drag and drop. Can let you drag items on the page, or drop files onto it
- File input (choose files to upload). Can open only the files you pick in the file chooser
Sources
How well checked: Based on official documentation.