Directory upload (webkitdirectory)
Lets the person pick a whole folder; the page gets every file in it with relative paths.
In one line
Can access every file inside a folder you choose, in order to upload them
Lets the person pick a whole folder; the page gets every file in it with relative paths.
One pick shares a full folder tree, often thousands of files. The site sees file names and sub folder structure, so a careless pick can expose more than expected.
What it can and can't do
What the user does: You click Upload folder and choose one.
It can
- Receive every file in the folder, with its path inside the folder
- Upload all of them
- Show file names and sizes
It cannot
- Change or delete the original files
- See other folders or files you did not include
- Get the files again later without another pick
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 7 | 2010-10-19 | None |
| Edge | Supported | 13 | 2015-11-12 | None |
| Firefox | Supported | 50 | 2016-11-15 | None |
| Safari | Supported | 11.1 | 2018-04-12 | None |
| Safari on iPhone | Supported | 18.4 | 2025-03-31 | All iOS browsers use WebKit |
| Chrome on Android | Supported | 132 | 2025-01-14 | None |
| Samsung Internet | Supported | 29.0 | 2025-10-25 | None |
How a site asks for it
| API | <input type=file webkitdirectory>; File.webkitRelativePath; DataTransferItem.webkitGetAsEntry() |
| Browser compat keys | api.HTMLInputElement.webkitdirectoryapi.File.webkitRelativePath |
| How access is granted | picker |
| What the user sees | None (no browser prompt) |
| Needs a secure context (HTTPS) | No |
| Needs a user gesture | Yes |
| Activation | transient |
| How long it lasts | Per selection |
| How to take it back | Nothing to revoke (no permission is stored) |
| Inside an iframe | Works in any frame |
Typical flow
- Person clicks the input
- Browser shows a folder chooser and, in Chrome, an Upload N files confirmation
- Page receives all files with webkitRelativePath
Data you get
Shape: none
No individual data fields. The signal is the access itself.
Technical limits
- Chrome shows a confirmation Upload N files to this site before handing over the list
- Includes all files in sub folders (hidden files and dot files may be included; Chrome filters OS junk like .DS_Store)
- Cannot browse parents or siblings of the chosen folder; webkitRelativePath starts at the chosen folder name
- No count cap; very large folders are bounded by memory and Chrome's confirmation counts them
- Support: Chrome 7, Safari 11.1, Firefox 50 (webkit prefix kept)
The story
What it is
Lets you pick a whole folder, and the page receives every file in it with its folder paths.
For you
You click upload, choose a folder, and the site gets all the files inside. It only gets what is in that folder, and you see a warning first.
For makers
It saves time for bulk uploads like photo sets, code projects and course files. The person picks the folder, so no ongoing access is given. It still can send a lot of data at once.
Where you see it
| Type | Example | Apps |
|---|---|---|
| productivity | You drag a project folder into a cloud drive and all its files and subfolders go up in one go. | Google Drive, Dropbox |
| social | You upload a whole album of photos at once. | None named |
| developer | You upload a code project folder to a build or hosting site. | GitHub, Netlify |
| games | A game mod site takes a whole mod folder for review. | None named |
| education | A student turns in a folder of project files to a class portal. | None named |
| creative | A 3D or music web tool loads a whole folder of assets. | None named |
Risks
- Large uploads
- Easy to include extra files
What the platform says
- MDN: webkitdirectory. Documents a file input option that lets a person choose a whole folder for upload.
Good uses and abuse
Legitimate uses
- Upload a photo album or code folder
- Static site deploy tools
Known abuse
- Collecting more files than the person expects from a deep folder
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 4 of 5 | How revealing the data is |
| Utility | 3 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
- 2010-05, Chrome 7: webkitdirectory ships
- 2016-11, Firefox 50: Firefox supports webkitdirectory
Related capabilities
Related
- File input (choose files to upload). Can open only the files you pick in the file chooser
- Dropping files and folders onto the page. Can receive files or whole folders you drag onto the page
Sources
How well checked: Based on official documentation.