Let user to specify local files from his computer
Flmngr.selectFiles
Opens a standard dialog of a browser where the user can specify a file or files from their computer for further use by your application.
This method does not open the standard File Manager dialog; instead, it opens just a simple file select dialog of a browser. Please note that this method should not be confused with the Flmngr.open({params})
method.
Then you can pass these files to the Flmngr.upload({params})
method to upload them to your server storage.
Code samples:
Parameters
-
Specify whether one or more files will be allowed to be selected.
Default is
false
. Optional -
acceptExtensions
:string[]A list of file extensions that are allowed to be selected.
For example, you can pass
[".doc", ".docx"]
if you only want to allow the selection of Microsoft Word documents. You can also specify allowed image extensions here.Note: Some legacy versions of browsers (especially their Linux versions) may ignore this parameter. So please double-check the file types selected by the user once you have received them.
Default is
null
(all file extensions are allowed). Optional -
onFinish
:(files: File[])This callback will be called after the user successfully selectes some files or images. The
files
argument will contain an array of standardFile
entities of a browser.Please note that there is no
onCancel
callback available since browsers do not support it.