Skip to main content

FileList

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.

MDN Reference

Indexable

[index: number]: File

Methods

[iterator]()

iterator: ArrayIterator<File>;

Returns

ArrayIterator<File>


item()

item(index): File | null;

The item() method of the FileList interface returns a File object representing the file at the specified index in the file list.

MDN Reference

Parameters

ParameterType
indexnumber

Returns

File | null

Properties

length

readonly length: number;

The length read-only property of the FileList interface returns the number of files in the FileList.

MDN Reference