title: Javascript: FileUri to blob conversion
body: <p>I want to upload files from local storage. But from local storage I'm getting file url something like <code>file:///data/user/0/application_package/cache/IMG-199201092.jpg</code>. I want to convert it to <code>blob</code> file or any <code>array</code> or <code>object</code> of <code>file</code> so that it can be send to server via <code>XMLHttpRequest</code>. So that on server i can save them. </p>
  
  <p>I'ave tried this code: </p>
  
  <pre><code>var reader = new FileReader();
  var blob_image = reader.readAsDataURL(imageUri);
  </code></pre>
  
  <p>but <code>blob_image</code> i couldn't fetch it on server via '$_FILES' as image or something. </p>
  
  <p>I'm getting imageUri from </p>
  
  <pre><code>$cordovaImagePicker.getPictures(options)
  .then(function (results) 
  {
     for (var i = 0; i &lt; results.length; i++)
      {
   var image_uri = results[i];
   var fd = new FormData();
   //Take the first selected file                             
   var blobbb = new Blob([new Uint8Array(results[i])], { type: "file" });
   fd.append("file", blobbb  );
   objXhr.onreadystatechange = function() {
  if (this.readyState == 4 &amp;&amp; this.status == 200) {
          console.log( objXhr.responseText );
          }
      };
   objXhr.open("POST", "http://someapi.com/api.php");
   objXhr.send(fd);
      }
  }
  </code></pre>