The mixedpicker is a selector that allows you to choose folders as files at the same time.

OurCodeWorld.Filebrowser.mixedPicker is a function that starts a mixed file and folder picker (allow you to choose files and folders at time).

Arguments Description
config

The config argument (first argument) is an object that can have the following properties:
  • success: a function that handles the success cordova result. The function receives as first and unique parameter an array with the selected files and folders.
  • error: a function that handles the error cordova result. The function receives as first and unique parameter a string with the error description.
  • startupPath: [optional] a string (default value "default")with a predetermined start up directory. If providen, the filebrowser will start from that location (file://emulated/0/a-custom-start-path)

Selecting folders and files

To start a mixed picker, use the following code:

OurCodeWorld.Filebrowser.mixedPicker({
    success: function(data) {
        if(!data.length){
            // No folder or files selected
            return;
        }

        console.log(data);
        // Array with the selected files and folders
        // ["file:///storage/emulated/0/myfile.txt","file:///storage/emulated/0/folder", "file:///storage/emulated/0/other-file.txt"]
    },
    error: function(e) {
        console.error("Error calling Hello Plugin",e);
    }
});

Cordova mixed filepicker android