coderef

<input type="file" webkitdirectory>Baseline · Newly available

The &#x3C;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: 155
Edge
12–12Not supported
13+Supportedsince Nov 12, 2015
Current: 154
Firefox
1–49Not supported
50+Supportedsince Nov 15, 2016
Current: 157
Safari
1–11Not supported
11.1+Supportedsince Apr 12, 2018
Current: 27
MobileChrome Android
18–131Not supported
132+Supportedsince Jan 14, 2025
Current: 155
Firefox Android
4–141Not supported
142+Supportedsince Aug 19, 2025
Current: 157
Safari iOS
1–18.3Not supported
18.4+Supportedsince Mar 31, 2025
Current: 27

How 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
}

Sub-features

Support for each part of the feature (3). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
File.webkitRelativePath13135011.11814211.3
HTMLInputElement.webkitdirectory7135011.113214218.4
input.webkitdirectory7135011.113214118.4