title: Ionic window.resolveLocalFileSystemURL not working for jpgs
body: <p>I'm using the gallery to access images to upload. I'm having no trouble when I am uploading the image uri directly, but when I need to use fileEntry (for multi-part uploads) jpgs are not returning a fileEntry from their uri.  <em>Note: i'm using async:await, but I have the same issue with standard promises</em></p>
  
  <p>For example the following is the code I'm using to get the image uri</p>
  
  <pre><code>var imageUri = await this.takePicture(Object.assign(this.defaultOptions,{sourceType:this.camera.PictureSourceType.SAVEDPHOTOALBUM}));
  let newFile = new File([imageUri], "filename");
  this.uploadFile(newFile);
  </code></pre>
  
  <p>The following is the code for <code>takePicture()</code> that returns the imageUri</p>
  
  <pre><code>try{
    return await this.camera.getPicture(options);
  }catch(err){
    ...handle error
  }
  </code></pre>
  
  <p>This code above <strong>successfully</strong> uploads both <code>png</code> and <code>jpg</code> files.  </p>
  
  <p>This code below fails to retrieve a fileEntry for only <code>jpg</code> files.</p>
  
  <pre><code>    /**
     * Returns a file entry for the image uri provided
     * @param imgUri image Uri to get file entry for
     */
    private async getFileFromImageUri(imgUri){ 
      try{
        var fileEntry = await this.resolveFileAsPromise(imgUri);
      }catch(err){
        // fileEntry = await this.createNewFileEntry(imgUri);
        this.presentToast('Error while selecting image.');  //TODO: images that are .jpg seem to have trouble being resolved to a file.
      }
      return fileEntry;      
    }
  </code></pre>
  
  <p><code>resolveFileAsPromise(ImgUri);</code> is a promise wrapper for <code>window.resolveLocalFileSystemURL(imgUri, resolve, reject);</code> It returns the following error</p>
  
  <p><code>FileError {code: 5}</code> for jpgs only.  The error code means that there was some trouble with the format of the jpg? This doesn't make sense to me as all of that is being handled internally. The images are not corrupted or anything so it leads me to believe that possibly the error code is misleading? <a href="https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-file/index.html#list-of-error-codes-and-meanings" rel="nofollow noreferrer">error code docs</a></p>
  
  <p>Has anyone encountered this issue? I am testing on a live android device (not an emulator).</p>
  
  <p>I feel that the above demonstrates that the image uri is not the problem since it works to upload images when I don't need to get to the fileEntry.  But, when I do, it works for only a particular filetype <code>png</code>s. </p>