new FileUtils()
File utils is used to read and write files.
Can be used alongside with object serialization to store and load objects from file.
- Source:
Methods
(static) read(fname, onLoad, onError)
Read a local or remote file as text data.
Parameters:
Name | Type | Description |
---|---|---|
fname |
string | Path or URL of the file being read. |
onLoad |
function | onLoad callback receives the read data as parameter. |
onError |
function | onError call is called when a error occurs while reading the file. |
- Source:
(static) select(onLoad, filter)
Open file chooser dialog window for the user to select files stored in the system.
The files selected are retrieved using the onLoad callback that receives a array of File objects.
Parameters:
Name | Type | Description |
---|---|---|
onLoad |
function | onLoad callback that receives array of files as parameter. |
filter |
string | File type filter (e.g. ".zip,.rar, etc) |
- Source: