new FileListLoader(fileList, optionsopt)
A class for handling a list of files (FileList), processing each file with L.FileReader.
It extends L.Evented to use event handling.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
fileList |
FileList | The list of files to be processed. |
|
options |
Object |
<optional> |
Options for file reading. |
Example
L.FileListLoader(fileList)
.on('load', function(e) {
console.log(e.file.name, e.reader.result);
})
.on('loaded', function() {
console.log('All files processed');
})
.load();
Extends
- L.Evented
Methods
-
static loadFiles(optionsopt) → {L.FileListLoader}
-
Instantiates a
L.FileListLoaderobject and initiates a file chooser dialog. This simulates a click on a hiddeninputHTML element created using the specifiedoptions. It then calls theloadmethod with the list of files chosen by the user.Parameters:
Name Type Attributes Description optionsObject <optional>
Options for the file input, like
accept,multiple,capture.