title: Ionic - Get file from audio recorded with cordova plugin media
body: <p>I'm use ionic with <a href="https://github.com/apache/cordova-plugin-media" rel="nofollow noreferrer">cordova-plugin-media</a> to record audio and i want upload the audio recorded to server using <a href="https://github.com/nervgh/angular-file-upload" rel="nofollow noreferrer">angular-file-upload</a> but i dont know how to get file from Media. I just try this:</p>
  <p>Controller:</p>
  <pre><code>$scope.itemOnLongPress = function (id) {;
              myMedia = new Media(&quot;./sound/recorded.wav&quot;);
              myMedia.startRecord();
  }
  
  $scope.itemOnTouchEnd = function (id) {
      myMedia.stopRecord();
      myMedia.play();
      window.resolveLocalFileSystemURI(myMedia.src,
          // success callback; generates the FileEntry object needed to convert to Base64 string
          function (fileEntry) {
              // convert to Base64 string
              function win(file) {
                  var reader = new FileReader();
                  reader.onloadend = function (evt) {
                      var obj = evt.target.result; // this is your Base64 string
                      alert(obj);
                  };
                  reader.readAsDataURL(file);
              };
              var fail = function (evt) {};
              fileEntry.file(win, fail);
          },
          // error callback
          function () {
              alert('fail');
          }
      );
  </code></pre>
  <p>All time i getting &quot;fail&quot; from event, i try use some prefix like: &quot;/sdcard/recorded.wav&quot;,&quot;file:///sound/recorded.wav&quot;,&quot;documents://recorded.wav&quot; but everytime same error...</p>
  <p>anyone know how i can get this file?</p>