I am using FileChooser to choose a file from my internal storage of my phone and File plugin to convert it into base64 but this.file.readAsDataUrl is giving error “FileError{code:2, Message:SECURITY_ERR}”
I have all required permissions still the problem persists below is my code
let base=this
if(this.platform.is('android')){
this.fileChooser.open()
.then(uri => {
var array = uri.split("/");
var path=uri.substring(0, uri.lastIndexOf("/") + 1);
console.log("path"+path)
base.file.readAsDataURL(path, uri).then(dataText=>{
console.log(dataText)
var data = dataText;
},(error)=>{
console.log(error)
})
//console.log(uri)
})
.catch(e => console.log(e));
}
I am using Ionic 3, Angular4, Typescript, Firebase