title: Cordova-plugin-file Encoding_Err on Android
body: <p>I have an Ionic 3 App where I can upload picture from a device. This feature works well with IOS, but fail on Android with the error code 5 (Encoding error).</p>
  
  <p>This is the flow : </p>
  
  <pre><code>protected takePicture(source: number, callback: any) {
    const options: CameraOptions = {
      sourceType: source,
      mediaType: 2,
    };
    this.camera.getPicture(options).then((imageData) =&gt; {
      return callback(imageData)
    });
  }
  </code></pre>
  
  <p>And then : </p>
  
  <pre><code>let promise = new Promise((resolve, reject) =&gt; {
      let prefix = '';
      if (i.indexOf('file://') === -1 &amp;&amp; i !== '') {
        prefix = 'file://';
      }
      this.file.resolveLocalFilesystemUrl(prefix + i).then((fileEntry: any) =&gt; {
        fileEntry.file((file: any) =&gt; {
          let reader = new FileReader();
          if (file.size &gt; 99999999) {
            return this.events.publish('error', this.errorUploadMessage, false);
          }
          reader.onloadend = function(e) {
            let blob = new Blob([this.result], { type: file.type });
            let filename = file.name;
            let extension = filename.match(/^.*\./);
            if (!extension || extension === '') {
              let type = file.type.split('/').pop();
              filename = filename + '.' + type;
            }
            resolve({ blob: blob, name: filename });
          };
          reader.readAsArrayBuffer(file);
        });
      }, (error) =&gt; {
        console.log(error);
        this.events.publish('error', this.errorUploadMessage, false);
      });
    });
  </code></pre>
  
  <p>Everything work well with IOS so I don't understand why not with android. When I check the path here:
  <code>this.file.resolveLocalFilesystemUrl(prefix + i)</code></p>
  
  <p>I have this :
  <code>file://content://com.android.providers.media.documents/document/image%3A1313</code></p>
  
  <p>Maybe the problem comes from 'image%3A1313' at the end. On IOS I can se the real picture name and extension (.jpeg for exemple).</p>
  
  <p>I already checked several issues on SOF, but nothing work or seems to be revelant to my issue.</p>