ENCODING_ERR when reading image file from absolute URL

Viewed 3273

I am following this guide on how to upload an image file using Ionic 3 on an iPhone Simulator. However I am stuck at this error printed from console

{"code":5,"message":"ENCODING_ERR"}

The code is as follows:

      this.file.resolveLocalFilesystemUrl(dto.image)
        .then((entry: FileEntry) => entry.file(file => {
          const reader = new FileReader();
          reader.onloadend = () => {
            //do something
          };
          reader.readAsArrayBuffer(file);
        }))
        .catch(err => console.log(JSON.stringify(err)));

the value of dto.image is:

/Users/myUsername/Library/Developer/CoreSimulator/Devices/05972D1E-F805-46E4-B164-BB95F116697A/data/Containers/Data/Application/1096409B-6FA3-4660-97AE-EAF3E2472046/tmp/cdv_photo_013.jpg

I am using ionic native File plugin

Thanks in advance.

1 Answers
Related