|Author:||Etha Robel III|
|Published:||22 February 2016|
|PDF File Size:||49.33 Mb|
|ePub File Size:||6.98 Mb|
|Uploader:||Etha Robel III|
A FileList interface, which represents an array of individually selected files from the underlying system.
The FileList object represents a list of files in the local file system. For instance, a list of files inside a directory. You will see how these file API objects are used in the following sections. Here is an input element example: You need an onchange listener too.
Selecting Multiple Files To enable the user to select multiple files, insert the multiple attribute into the input element. Here is a code example showing how to setup a drop zone HTML element so that you can detect when files are dragged onto it: When a file is dropped onto the drop zone HTML element, the drop function will be called.
Table of Contents
You will see how that looks in the following sections. It might be a good idea to style the drop zone HTML element to make it clear to the user that they can drag a file onto it, and where the borders of the drop zone are etc.
File - an individual file; provides readonly information such as name, file size, mimetype, and a reference to the file handle.
- HTML5 File API
- FileAPI API
Here's an example that uses the 'multiple' attribute to allow selecting several files at once: