FileList extension type

The FileList interface represents an object of this type returned by the files property of the HTML input element; this lets you access the list of files selected with the <input type="file"> element. It's also used for a list of files dropped into web content when using the drag and drop API; see the DataTransfer object for details on this usage.

All <input> element nodes have a files attribute of type FileList on them which allows access to the items in this list. For example, if the HTML includes the following file input:

<input id="fileItem" type="file" />

The following line of code fetches the first file in the node's file list as a File object:

const file = document.getElementById("fileItem").files[0];

Note: This interface was an attempt to create an unmodifiable list and only continues to be supported to not break code that's already using it. Modern APIs use types that wrap around ECMAScript array types instead, so you can treat them like ECMAScript arrays, and at the same time impose additional semantics on their usage (such as making their items read-only).

on
Implemented types

Properties

hashCode int
The hash code for this object.
no setterinherited
length int
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

item(int index) File?
The item() method of the FileList interface returns a File object representing the file at the specified index in the file list.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited