files property (input:file)
Returns a FileList collection that represents the file or files selected with the current input:file element.
Note: The files property is supported in Firefox from version 3.Through the FileList collection, you can get the name, size and the contents of the files. For example, it can be useful, if you want to check the files before upload.
By default, the input:file element only supports single file selection, but with the multiple property, you can allow users to upload more than one file with one input:file control during a form submission.If you need to get the path of the selected files in browsers that do not support the files property, use the value property.
You can find the related objects in the Supported by objects section below.
This property is read-only.
A FileList collection that represents the selected file or files.
Default: this property has no default value.
Example HTML code 1:
This example illustrates the use of the files property:
Did you find this example helpful?
User Contributed Comments