A native Android filebrowser (select and create files and folders) for Cordova
Java JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/android First commit Nov 8, 2016
www First commit Nov 8, 2016
LICENSE Initial commit Nov 8, 2016
README.md Update README.md Jan 16, 2017
plugin.xml First commit Nov 8, 2016

README.md

cordova-ourcodeworld-filebrowser Plugin

A cordova implementation of NoNonsense-FilePicker for Android.

This plugin allow you to select folder and files, and at the same time create folders and create files (not a file is created actually, but it will return the filepath and name of the "choosen path").

Installation

Install the plugin

$ cordova plugin add https://github.com/ourcodeworld/cordova-ourcodeworld-filebrowser.git

Usage

A global object OurCodeWorld.Filebrowser will be available in your window. This object offers a file picker, folder picker, mixed folder and file picker and the file creation dialog.

// Single file selector
window.OurCodeWorld.Filebrowser.filePicker.single({
    success: function(data){
        if(!data.length){
            // No file selected
            return;
        }

        // Array with filepaths
        // ["file:///storage/emulated/0/360/security/file.txt", "file:///storage/emulated/0/360/security/another-file.txt"]
    },
    error: function(err){
        console.log(err);
    }
});

// Single folder selector
window.OurCodeWorld.Filebrowser.folderPicker.single({
    success: function(data){
        if(!data.length){
            // No folders selected
            return;
        }

        // Array with paths
        // ["file:///storage/emulated/0/360/security", "file:///storage/emulated/0/360/security"]
        console.log(data);
    },
    error: function(err){
        console.log(err);
    }
});

Check the documentation to see more methods of the plugin like the creation of file, mixed file and folder picker etc.

External links