The webkitdirectory attribute works in Chrome 7+, Edge 13+, Firefox 50+, Safari 11.1+, Opera 15+, and Samsung Internet 29+. Learn the markup, limits, and quirks.

Prince Dewani
May 6, 2026
Input File Directory is the webkitdirectory HTML attribute on input type file that lets users pick a folder and all its nested files in one click. It works in Chrome 7+, Edge 13+, Firefox 50+, Safari 11.1+ on macOS, Safari 18.4+ on iOS, Opera 15+, and Samsung Internet 29+, while Internet Explorer never supported it.
This guide covers what the attribute is, the browsers that support it, key features, how to use it, and known issues to plan around.
Input File Directory is the webkitdirectory boolean attribute on the HTML input element with type file. When the attribute is set, the file chooser opens in folder mode, and the page receives every file inside the chosen folder and its subfolders through input.files. Each file also exposes its path through webkitRelativePath.
Every major desktop browser ships the webkitdirectory attribute today, mobile Safari shipped full support in Safari 18.4, and global usage covers more than 95% of page views.
Chrome supports the webkitdirectory attribute from Chrome 7 on Windows, macOS, Linux, and ChromeOS. The attribute was the original Chromium implementation that every other engine later mirrored. Chrome for Android exposes the folder picker from Chrome 147, and earlier Android Chrome versions only let users pick individual files.
Microsoft Edge supports webkitdirectory from Edge 13 on Windows, macOS, and Linux. The legacy EdgeHTML versions 12 and below did not expose the attribute. Chromium-based Edge 79 and later inherit the full Chrome behavior, including folder selection on the desktop file picker.
Firefox supports webkitdirectory from Firefox 50 on Windows, macOS, and Linux. Firefox for Android picked up the same support from Firefox 150. Mozilla shipped the attribute as a Chromium-compatibility alias, so the markup behaves the same way Chrome does, and webkitRelativePath fills in correctly.
Safari supports webkitdirectory from Safari 11.1 on macOS. Safari on iOS and iPadOS shipped full support in Safari 18.4, which lets users pick a folder from the Files app. Safari 11.3 to 18.3 on iOS exposed the attribute but only as partial support tied to iCloud Drive, where the folder list was limited.
Opera supports webkitdirectory from Opera 15 on Windows, macOS, and Linux, the first Chromium-based Opera release. Older Presto-based Opera 12 and below did not expose the attribute. Opera Mobile on Android picked up partial support from Opera Mobile 80, and earlier Opera Mobile builds did not.
Samsung Internet supports webkitdirectory in full from Samsung Internet 29 on Galaxy phones and tablets. Samsung Internet 4 to 28 exposed the attribute as partial support, where the folder picker only listed local storage roots and skipped cloud backed folders.
The Android WebView and the legacy Android Browser support webkitdirectory in full from version 147. Android Browser 4.4 through 4.4.4 had partial support, where the picker exposed the attribute but failed to walk subdirectories. Test folder uploads on a real device because emulator file pickers often skip the folder mode.
Internet Explorer does not support webkitdirectory in any version, including IE 6 through IE 11. Trident never carried the Chromium folder picker plumbing. Internet Explorer is end-of-life, so move folder upload flows to Chromium-based Edge, Chrome, or Firefox for any new build.
Note: Folder uploads behave differently across Chrome, Firefox, Safari, and mobile browsers. Test webkitdirectory on real browsers and OS with TestMu AI. Try TestMu AI free!
The webkitdirectory attribute is small in surface area, but it changes how the file picker, the FileList, and every File object behave. Five features carry the weight of the API.
You add the webkitdirectory attribute to an input type file, listen for the change event, and read each file plus its webkitRelativePath. Wire up the markup, the script, and a feature-detect once and the same code path covers Chrome, Edge, Firefox, Safari, Opera, and Samsung Internet.
The reference markup looks like this:
<input type="file" id="folder-picker" webkitdirectory multiple />
<ul id="file-listing"></ul>
<script>
const picker = document.getElementById("folder-picker");
const listing = document.getElementById("file-listing");
picker.addEventListener("change", (event) => {
listing.innerHTML = "";
for (const file of event.target.files) {
const item = document.createElement("li");
item.textContent = file.webkitRelativePath + " (" + file.size + " bytes)";
listing.appendChild(item);
}
});
</script>And the feature-detect snippet you can paste straight into the DevTools console:
// Paste this into the DevTools console to confirm folder picker support.
const probe = document.createElement("input");
probe.type = "file";
if ("webkitdirectory" in probe) {
console.log("Folder upload via webkitdirectory is supported.");
} else {
console.log("This browser does not expose the webkitdirectory attribute.");
}Folder upload looks simple, but the attribute carries a stack of cross-browser quirks around mobile pickers, drag-and-drop, and path handling.
In my experience, the silent killer is the iOS picker change. A flow that worked perfectly on macOS Safari and a recent iPhone broke on an older iPad because the iCloud-only chooser hid the folder users wanted to pick. Always test on a real device that matches the iOS version your users actually run, not the latest one.
All Input File Directory version numbers and platform notes in this guide come from these primary sources:
Did you find this page helpful?
More Related Hubs
TestMu AI forEnterprise
Get access to solutions built on Enterprise
grade security, privacy, & compliance