Table of Contents

Class FileList

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

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.

[Value("FileList")]
public class FileList
Inheritance
FileList
Inherited Members

Remarks

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:

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

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 represent list structures using types based on JavaScript arrays, thus making many array methods available, and at the same time imposing additional semantics on their usage (such as making their items read-only).

These historical reasons do not mean that you as a developer should avoid FileList. You don't create FileList objects yourself, but you get them from APIs such as Files, and these APIs are not deprecated. However, be careful of the semantic differences from a real array.

-Using files from web applications
-File
-FileReader

See also on MDN

Constructors

FileList()

public FileList()

Properties

Length

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

[Value("length")]
public ulong Length { get; }

Property Value

ulong

A number indicating the number of files in the list.

Remarks