Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. HTMLInputElement
  4. webkitEntries

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.

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

html
<input type="file" multiple />

JavaScript

js
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

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp