File APIBaseline · Widely available
The File API represents and reads from file data and metadata. Typically, you get files through other APIs, such as the <input type="file"> element or drag-and-drop events. You may also send file data to other APIs, such as creating images or drawing on canvases.
Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Jan 15, 2020. Widely available since Jul 15, 2022.
Browser support
DesktopChrome
1–37Not supported
38+Supportedsince Oct 7, 2014
Current: 155Edge
12–18Not supported
79+Supportedsince Jan 15, 2020
Current: 154Firefox
1–27Not supported
28+Supportedsince Mar 18, 2014
Current: 157Safari
1–10Not supported
10.1+Supportedsince Mar 27, 2017
Current: 27MobileChrome Android
18–37Not supported
38+Supportedsince Oct 8, 2014
Current: 155Firefox Android
4–27Not supported
28+Supportedsince Mar 18, 2014
Current: 157Safari iOS
1–10Not supported
10.3+Supportedsince Mar 27, 2017
Current: 27How to use
This feature is Baseline widely available — use it freely, no fallback needed.
Example
Full syntax and examples are on MDN: Blob.
Feature detection
JS · check before using
if ("File" in globalThis) {
// File is available
} else {
// load a polyfill or use a fallback
}Specification
Usage share
Sub-features
Support for each part of the feature (40). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| Blob | 5 | 12 | 4 | 6 | 18 | 4 | 6 |
| Blob.Blob | 20 | 12 | 13 | 6 | 25 | 14 | 6 |
| Blob.arrayBuffer | 76 | 79 | 69 | 14 | 76 | 79 | 14.5 |
| Blob.bytes | 144 | 144 | 128 | 18 | 144 | 128 | 18 |
| Blob.size | 5 | 12 | 4 | 6 | 18 | 4 | 6 |
| Blob.slice | 21 | 12 | 13 | 7 | 25 | 14 | 7 |
| Blob.stream | 76 | 79 | 69 | 14.1 | 76 | 79 | 14.5 |
| Blob.text | 76 | 79 | 69 | 14 | 76 | 79 | 14.5 |
| Blob.type | 5 | 12 | 4 | 6 | 18 | 4 | 6 |
| File | 13 | 12 | 3 | 4 | 18 | 4 | 3.2 |
| File.File | 38 | 79 | 28 | 10.1 | 38 | 28 | 10.3 |
| File.lastModified | 13 | 18 | 15 | 10 | 18 | 15 | 10 |
| File.name | 13 | 12 | 3.6 | 8 | 18 | 4 | 8 |
| FileList | 2 | 12 | 3 | 4 | 18 | 4 | 3.2 |
| FileList.item | 2 | 12 | 3 | 4 | 18 | 4 | 3.2 |
| FileList.length | 2 | 12 | 3 | 4 | 18 | 4 | 3.2 |
| FileReader | 6 | 12 | 3.6 | 6 | 18 | 32 | 6 |
| FileReader.FileReader | 6 | 12 | 3.6 | 6 | 18 | 32 | 6 |
| FileReader.abort | 6 | 12 | 3.6 | 6 | 18 | 32 | 6 |
| FileReader.abort_event | 6 | 12 | 3.6 | 6 | 18 | 32 | 6 |
Show 20 more
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| FileReader.error | 6 | 12 | 3.6 | 6 | 18 | 32 | 6 |
| FileReader.error_event | 6 | 12 | 3.6 | 6 | 18 | 32 | 6 |
| FileReader.load_event | 6 | 12 | 3.6 | 6 | 18 | 32 | 6 |
| FileReader.loadend_event | 6 | 12 | 3.6 | 6 | 18 | 32 | 6 |
| FileReader.loadstart_event | 6 | 12 | 79 | 6 | 18 | 79 | 6 |
| FileReader.progress_event | 6 | 12 | 3.6 | 6 | 18 | 32 | 6 |
| FileReader.readAsArrayBuffer | 6 | 12 | 3.6 | 6 | 18 | 32 | 6 |
| FileReader.readAsDataURL | 6 | 12 | 3.6 | 6 | 18 | 32 | 6 |
| FileReader.readAsText | 6 | 12 | 3.6 | 6 | 18 | 32 | 6 |
| FileReader.readyState | 6 | 12 | 3.6 | 6 | 18 | 32 | 6 |
| FileReader.result | 6 | 12 | 3.6 | 6 | 18 | 32 | 6 |
| FileReader.worker_support | 6 | 12 | 46 | 6 | 18 | 46 | 6 |
| FileReaderSync | 7 | 12 | 8 | 6 | 18 | 8 | 6 |
| FileReaderSync.FileReaderSync | 7 | 12 | 8 | 6 | 18 | 8 | 6 |
| FileReaderSync.readAsArrayBuffer | 9 | 12 | 8 | 6 | 18 | 8 | 6 |
| FileReaderSync.readAsDataURL | 7 | 12 | 8 | 6 | 18 | 8 | 6 |
| FileReaderSync.readAsText | 7 | 12 | 8 | 6 | 18 | 8 | 6 |
| FileReaderSync.worker_support | 7 | 12 | 8 | 6 | 18 | 8 | 6 |
| URL.createObjectURL_static | 32 | 12 | 19 | 7 | 32 | 19 | 7 |
| URL.revokeObjectURL_static | 32 | 12 | 19 | 7 | 32 | 19 | 7 |