length property
Returns the number of files contained in a FileList object.
This property is read-only.
![]() |
Syntax
var numFiles = object.length;
Property values
Type: number
The number of File objects in the FileList object.
Remarks
Returns the number of files that are selected and available on the FileList object. This value can be greater than or equal to 1 if multiple file selection is enabled (typically via the multiple attribute on the input element). If no files have been selected, 0 is returned.
See also
Show:
