< apis‎ | file
Jump to: navigation, search


This article is Ready to Use.

W3C Working Draft


FileList is an object which represents an array of individually selected files from the underlying system.


API Name Summary
length length returns the number of files in the FileList object. If there are no files, this attribute must return 0.


API Name Summary
item item returns the indexth File object in the FileList. If there is no indexth File object in the FileList, then this method must return null.


No events.


There is no data available for topic "webapi", feature "FileList". If you think that there should be data available, consider opening an issue.


iterates over all the files selected by the user using an input element


// fileInput is an HTML input element: input type="file" id="myfileinput" multiple
var fileInput = document.getElementById("myfileinput");
// files is a FileList object (similar to NodeList)
var files = fileInput.files;
var file;
// loop trough files
for (var i = 0; i < files.length; i++) {
    // get item
    file = files.item(i);
    file = files[i];

Related specifications

Specification Status Related Changes
W3C File API Specification W3C Working Draft


This article contains content originally from external sources.

Portions of this content come from the Mozilla Developer Network
Error creating thumbnail: File missing
: [FileList Article]

Portions of this content come from the Microsoft Developer Network: [fileList Object Article]