title: How to access image from native URI (assets-library) in Cordova for iOS
body: <p>I have a Cordova/PhoneGap app which uses the camera to capture a picture. I need to access this picture to send to my server.</p>
  
  <p>For Android I simply use <code>$cordovaFile.readAsDataURL(cordova.file.dataDirectory, fileName)</code></p>
  
  <p>However; on iOS the filename does not come back as such. My return value for iOS shows the path as </p>
  
  <blockquote>
    <p>assets-library://asset/asset.JPG?id=539425FE-43AA-48E7-9865-D76348208AC7&amp;ext=JPG</p>
  </blockquote>
  
  <p>How can I access and read this image? I'd prefer to stick with $cordovaFile but just want to get it to work.</p>
  
  <p>I am using CordovaCameraPreview plugin and the best I can get back from the picture taker handler seems to be something formed similar to:</p>
  
  <blockquote>
    <p>assets-library://asset/asset.JPG?id=990355E1-200A-4E35-AAA1-7D461E3999C8&amp;ext=JPG
    assets-library://asset/asset.JPG?id=C49FF0EB-CCCB-45B2-8577-B13868D8DB29&amp;ext=JPG</p>
  </blockquote>
  
  <p>How can I convert this to a filename and path that I can read with $cordovaFile? According to their documentation (<a href="http://ngcordova.com/docs/plugins/file/" rel="noreferrer">http://ngcordova.com/docs/plugins/file/</a>) it looks like I need to use one of their paths for File System Layout. It works fine on Android using cordova.file.dataDirectory but can't figure out how to access on iOS</p>
  
  <p>I've also tried using <code>window.resolveLocalFileSystemURL(path)</code> but am getting undefined as my result.</p>
  
  <p><strong>Update</strong></p>
  
  <p>I feel like I'm getting closer... using <code>window.resolveLocalFileSystemURL(path,resolveOnSuccess, resOnError);</code> I get more information</p>
  
  <pre><code>name: "assets-library"
  fullPath: "/asset/asset.JPG?id=711B4C9D-97D6-455A-BC43-C73059A5C3E8&amp;ext=JPG"
  name: "asset.JPG?id=711B4C9D-97D6-455A-BC43-C73059A5C3E8&amp;ext=JPG"
  nativeURL: "assets-library://asset/asset.JPG?id=711B4C9D-97D6-455A-BC43-C73059A5C3E8&amp;ext=JPG"
  </code></pre>
  
  <p>It looks like I now need to use the fullPath but still can't figure out how to access with $cordovaFile</p>
  
  <p>If I try to use <code>$cordovaFile.readAsDataURL(cordova.file.dataDirectory, data.name)</code> where data.name is asset.JPG?id=711B4C9D-97D6-455A-BC43-C73059A5C3E8&amp;ext=JPG I get a file not found error</p>
  
  <p><strong>Update 2</strong></p>
  
  <p>I have tried using every single File System Layout available at <a href="http://ngcordova.com/docs/plugins/file/" rel="noreferrer">http://ngcordova.com/docs/plugins/file/</a> and receive the same File Not Found error on each one. Still no clue how to access a file in assets-library using $cordovaFile</p>