don / cordova-filechooser

Cordova Plugin that supplies a File Chooser
Other
97 stars 215 forks source link

permissions #38

Open DimaKajola opened 6 years ago

DimaKajola commented 6 years ago

Hi, I'm using your plugin in my project and recently I detected the next issue: if I try to get the file content console.log(base64); it displays an empty string. But if I used before the functionality of cordova-plugin-camera in the app ( picked some photo, etc) the issue is gone because in cordova-plugin-camera I was needed to Allow access permissions for the plugin. I'm new in Ionic and can't get the solution for this bug.

Here is my code sample: fileChooser.open(function (uri) { if ($scope.message_id) { var source_path; if (uri.indexOf('content://') === 0) { window.FilePath.resolveNativePath( uri, function (path) { window.plugins.Base64.encodeFile(path, function (base64) { console.log(base64); }); }, function (e) { / don't do anything for now / } ); } else { window.plugins.Base64.encodeFile(uri, function (base64) { console.log(base64); }); } } });