title: Get Base64 from imageURI with PhoneGap
body: <p>I'm trying to get the base64 from an image that picked from the album on my phone, but I cannot make it work:</p>
  
  <p>I tried this:</p>
  
  <pre><code>window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSystem) {
      console.log("0");
      fileSystem.root.getFile(imageURI, null, function(fileEntry) {
          console.log("1");
          fileEntry.file(function(file) {
              console.log("2");
              var reader = new FileReader();
              reader.onloadend = function(evt) {
                  console.log("Read complete!");
                  image64.value = Base64.encode(evt.target.result);
              };
              reader.readAsText(file);
          }, failFile);
      }, failFile);
  }, failSystem);
  </code></pre>
  
  <p>Although the image is displayed correctly.. I receive an error from this function:</p>
  
  <pre><code>fileSystem.root.getFile(imageURI, null, function(fileEntry)
  </code></pre>
  
  <p>And the error is: <strong>FileError.ENCODING_ERR</strong></p>
  
  <p>I know that code doesn't look pretty. But I don't know how to get the Base64 encoding from an imageURI.</p>