Bulk photo library and file system
A site cannot browse your photo library or disk by itself.
In one line
Can't browse your whole photo library or your files on its own
A site cannot browse your photo library or disk by itself.
Only files the person picks (or a folder they grant) are visible. No silent photo, music or Downloads scan.
What it can and can't do
What the user does: You tap Upload and pick files or a folder yourself each time.
It can
- Open the files you pick in a file chooser
- Open a folder you pick, in browsers that allow it
- Remember a folder you pick for later in some browsers, if you grant it again
It cannot
- See your photo library or your files without you picking them
- Browse folders or look at file names you did not choose
- Keep access after you close the page in most cases
- Pick files on your behalf without the file chooser
Browser support
| Browser | Status | First version | Note |
|---|---|---|---|
| Chrome | Not supported | Not available | Only via pickers |
| Edge | Not supported | Not available | Only via pickers |
| Firefox | Not supported | Not available | Only via pickers |
| Safari | Not supported | Not available | Only via pickers |
| Safari on iPhone | Not supported | Not available | Only via pickers |
| Chrome on Android | Not supported | Not available | Only via pickers |
| Samsung Internet | Not supported | Not available | Only via pickers |
How a site asks for it
| API | <input type=file>, showOpenFilePicker(), showDirectoryPicker() |
| Browser compat keys | api.Window.showOpenFilePicker |
| How access is granted | not-exposed |
| What the user sees | File chooser or folder grant required each time |
| Needs a secure context (HTTPS) | Yes |
| Needs a user gesture | No |
| How long it lasts | Per origin |
| How to take it back | Site settings |
| Inside an iframe | Same as top level; cross-origin iframes need a permissions policy where listed |
Typical flow
- Call the API
- Browser applies its access rules
- Page receives the result
Data you get
What comes back: A site cannot browse your photo library or disk by itself.
Shape: object
How often: on demand
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
picked File | object | bytes | user selected only | Not listed |
directory handle | object | None | one folder tree after Allow | Not listed |
Technical limits
- No enumeration of photos, contacts, messages or system folders
- Folder grants exclude system folders such as Downloads root and home
- iOS gives only the picker's selected photos
The story
What it is
A site cannot browse your photos or files by itself.
For you
You choose which photo or file to upload. The site sees only what you pick, nothing else on your device.
For makers
Apps wanted to scan whole photo libraries to find faces or sort things and to build profiles. Instead they use a file picker that shows one thing at a time, or ask for one folder.
Where you see it
| Type | Example | Apps |
|---|---|---|
| social | A photo app wants to scan all your pictures for faces. Instead you pick one image to post. | Instagram web |
| shopping | A resale site wants to see your gallery. Instead you pick up to ten photos of an item. | Depop, Etsy |
| productivity | A cloud drive wants your whole folder. It asks you to choose one folder to sync. | Google Drive, Dropbox |
| creative | An editor wants your whole library, but you open each project file by hand. | Photopea |
| security | Malware wants to scan your documents. The browser will not let a page read files you did not pick. | None named |
| kids | A school portal asks a child to pick one picture, never the whole camera roll. | None named |
Risks
- Social engineering
- Picking the wrong file
Good uses and abuse
Legitimate uses
- Upload flows
Known abuse
- Social engineering to pick sensitive files
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 3 of 5 | How revealing the data is |
| Utility | 3 of 5 | How useful it is to honest apps |
| Friction | 2 of 5 | How much the user has to do |
| Fingerprint bits | Not rated | Rough identifying entropy, when known |
History
- 2020, Chrome 86: File System Access API (desktop Chrome)
Sources
How well checked: Based on official documentation.