Mojo.FilePicker
| Method Name and Description |
|---|
|
Mojo.FilePicker.pickFile(params, stageController)
|
Method Detail
Method to pick a single file from the device's local storage
Params object description:
Type Name Required Description
---------------------------------------------------------------------------------------------------------------------------------
{Function} params.onSelect Required method to call after selection is made and scene is returned.
It will return an object of the following format:
{ fullPath: '/full/path/of/selected/file' }
{Function} params.onCancel Optional method to call after selection is made and scene is returned.
{Array} params.kinds Optional array of pseudo type to allow ('image', 'audio', 'video', 'file')
default is all kind are supported. If only one pseudo type is needed,
kind: 'mytype' can be used and override kinds
{String} params.defaultKind Optional default view to go to. In ('image', 'audio', 'video', 'file')
{String} params.actionType Optional "attach" and "open" are the only supported option, "open" being the default.
Only "attach" display an icon for now.
{String} params.actionName Optional free form string to override the default string defined by actionType
{Array} params.extensions Optional array of file extensions (Strings) to filter in the files (others) view.
Example params:
{ kind: 'file', extensions: ['doc', 'docx'] }
{ kinds: ['audio', 'video'], defaultKind: 'video' }
{ actionType: 'attach', kinds: ['image'], crop: { width: 150, height: 150 } }
{ actionType: 'attach', kinds: ['image'] }
{ actionType: 'attach', kinds: ['audio', 'video'], defaultKind: 'audio' }
{ actionName: 'Select', kinds: ['other'] }
- Parameters:
- {Object} params
- Object containing information about the file to select as described above.
- {Object} stageController
- The calling application's stage assistant.