Requires Cordova >= 2.8.0
$ cordova plugin add http://github.com/ihadeed/cordova-filechooser.git
$ plugman --platform android --project /path/to/project \
--plugin http://github.com/ihadeed/cordova-filechooser.git
fileChooser.open(filter, successCallback, failureCallback); // with mime filter
fileChooser.open(successCallback. failureCallback); // without mime filter
{ "mime": "application/pdf" } // text/plain, image/png, image/jpeg, audio/wav etc
{ "mime": "application/pdf|text/plain|image/png" }
The success callback gets the uri of the selected file
fileChooser.open(function(uri) {
alert(uri);
});
- Android
- Windows (UWP)
TODO rename open
to pick, select, or choose.