HTMLInputElement: webkitEntries property
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
The read-onlywebkitEntriesproperty of theHTMLInputElement interface contains an array of filesystem entries (as objects based onFileSystemEntry) representing filesand/or directories selected by the user using an<input> element oftypefile, but only if that selection was made using drag-and-drop:selecting a file in the dialog will leave the property empty.
The array can only contain directories if thewebkitdirectory property istrue. This means the<input> element was configured tolet the user choose directories.
Note:This property is calledwebkitEntries in the specification due to itsorigins as a Google Chrome-specific API. It's likely to be renamed someday.
In this article
Value
An array of objects based onFileSystemEntry, each representing one filewhich is selected in the<input> element. More specifically, files arerepresented byFileSystemFileEntry objects, and, if they're allowed,directories are represented byFileSystemDirectoryEntry objects.
Examples
This example shows how to create a file selection<input> elementand process the selected files.
HTML
<input type="file" multiple />JavaScript
document.getElementById("files").addEventListener("change", (event) => { event.target.webkitEntries.forEach((entry) => { /* do stuff with the entry */ });});Each time achange event occurs, this code iterates over the selectedfiles, obtaining theirFileSystemEntry-based objects and acting on them.
Specifications
| Specification |
|---|
| File and Directory Entries API> # dom-htmlinputelement-webkitentries> |