<input type="file" webkitdirectory>Baseline · Newly available
The <input type="file" webkitdirectory> HTML element shows a file picker from which users can choose a folder to upload with the form.
Works in the latest version of every major browser, but older devices may not support it yet. Baseline since Aug 19, 2025.
Browser support
DesktopChrome
1–12Not supported
13+Supportedsince Aug 2, 2011
Current: 155Edge
12–12Not supported
13+Supportedsince Nov 12, 2015
Current: 154Firefox
1–49Not supported
50+Supportedsince Nov 15, 2016
Current: 157Safari
1–11Not supported
11.1+Supportedsince Apr 12, 2018
Current: 27MobileChrome Android
18–131Not supported
132+Supportedsince Jan 14, 2025
Current: 155Firefox Android
4–141Not supported
142+Supportedsince Aug 19, 2025
Current: 157Safari iOS
1–18.3Not supported
18.4+Supportedsince Mar 31, 2025
Current: 27How to use
Every current browser supports this, but it only became Baseline on Aug 19, 2025. Use it as a progressive enhancement, or keep a fallback if you support older devices.
Example
Full syntax and examples are on MDN: webkitRelativePath.
Feature detection
JS · check before using
if ("HTMLInputElement" in globalThis && "webkitdirectory" in HTMLInputElement.prototype) {
// HTMLInputElement.webkitdirectory is available
}Documentation (MDN)
Specification
Usage share
Sub-features
Support for each part of the feature (3). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| File.webkitRelativePath | 13 | 13 | 50 | 11.1 | 18 | 142 | 11.3 |
| HTMLInputElement.webkitdirectory | 7 | 13 | 50 | 11.1 | 132 | 142 | 18.4 |
| input.webkitdirectory | 7 | 13 | 50 | 11.1 | 132 | 141 | 18.4 |