Extension & Emerging Attributes

webkitdirectory

Build a form with the HTML form generator

Boolean file-input attribute requesting directory selection. Selected files can expose relative paths through webkitRelativePath; the historical prefix remains in the API. Validate file paths and contents on the server and provide a regular file-selection fallback for unsupported devices.

Formal Syntax & Structure

html syntaxhtml
<input type="file" webkitdirectory>

Parameters & Attributes

NameTypeDescription
webkitdirectorybooleanPresence requests directory selection.

Working Example

Example Snippethtml
<label>  Choose folder  <input type="file" webkitdirectory multiple></label>

Browser Compatibility

Minimum supported versions across modern rendering engines

Chrome
7
Yes
Edge
13
Yes
Firefox
50
Yes
Safari
11.1
Yes
Checked desktop BCD snapshot: webkitdirectory on input; desktop directory selection. Versions denote the recorded start of support (≤ means at least that early), not a guarantee of all behavior. Unresolved mirror and preview rows omitted. Mobile picker behavior is separately versioned.
HTML Reference