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.FileListLoader
object and initiates a file chooser dialog. This simulates a click on a hiddeninput
HTML element created using the specifiedoptions
. It then calls theload
method with the list of files chosen by the user.Parameters:
Name Type Attributes Description options
Object <optional>
Options for the file input, like
accept
,multiple
,capture
.