title: Send a recorded file via Filetransfer with Cordova/Phonegap
body: <p>I am trying to send a voice recording that I recorded via the Media plugin.</p>
  
  <p>When I try to send the file I get this FileError.NOT_FOUND_ERR error:</p>
  
  <pre><code>Error opening file /myRecording100.wav: Error Domain=NSCocoaErrorDomain Code=260 "The operation couldn’t be completed. (Cocoa error 260.)" UserInfo=0xa358640 {NSFilePath=/myRecording100.wav, NSUnderlyingError=0xa34fb30 "The operation couldn’t be completed. No such file or directory"}
  2014-08-06 17:02:26.919 Bring Me[40961:c07] FileTransferError {
      code = 1;
      source = "/myRecording100.wav";
      target = "http://XXXX.xom";
  }
  </code></pre>
  
  <p>However, <strong>I can play the voice recording after recording it</strong>.</p>
  
  <p>Why would I be able to play the file (showing that the file was recorded and <strong>saved correctly</strong>) but FileTransfer be <strong>unable to send it?</strong></p>
  
  <p>Here is my code (for ios):</p>
  
  <pre><code>var my_recorder = null;
  var mediaFileFullName = null; // iOS
  var mediaRecFile = "myRecording100.wav";
  var checkFileOnly = false;
  
  /******
   Call when start recording
  ******/
  function startRecording() {
      checkFileOnly = false;
      window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onSuccessFileSystem, function() {
          console.log("***test: failed in creating media file in requestFileSystem");
      });
  }
  
  function onSuccessFileSystem(fileSystem) {
      if (checkFileOnly === true) {        
          // Get File and send
          fileSystem.root.getFile(mediaRecFile, { create: false, exclusive: false }, onOK_GetFile, onFail_GetFile);
      }
      else {
          // Create File
          fileSystem.root.getFile(mediaRecFile, { create: true, exclusive: false }, onOK_SaveFile, onFail_GetFile);
        }
  }
  
  /* Save the file*/
  function onOK_SaveFile(fileEntry) {
      mediaFileFullName = fileEntry.fullPath;
      my_recorder = new Media(mediaFileFullName, 
          function() { document.location ="address_form.html"; // Redirect the user to an other page  },
          function(err) { console.log("playAudio():callback Record Error: "+err);}
      );
      my_recorder.startRecord();
  }
  
  /* Get the file and send it */
  function onOK_GetFile(fileEntry) {
      mediaFileFullName = fileEntry.fullPath;
      /*
          // Read the recorded file is WORKING !
          my_player = new Media(mediaFileFullName, onMediaCallSuccess, onMediaCallError);
          my_player.play();
      */
      var options = new FileUploadOptions();
      options.fileKey = "want";
      options.fileName = "file.wav";
      options.mimeType = "audio/wav";
      options.chunkedMode = false;
      options.params = parameters;
  
      var ft = new FileTransfer();
      ft.upload(mediaFileFullName, "https://SERVER_ADDRESS", win, fail, options);
  }
  
  
  
  /******
      Called when stop recording
  ******/
  function stopRecording() {
      if (my_recorder) {
          my_recorder.stopRecord();
      }
  }
  </code></pre>