Skip to content

permissions #38

@DimaKajola

Description

@DimaKajola

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);
});
}
}
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions