Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Cordova File Plugin giving Security error on using readAsDataUrl

$
0
0

@kkhurana696 wrote:

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

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>