title: Issue in moving/copying captured image phonegap android
body: <p>Phonegap Version : 3.3</p>
  
  <p>Android Version : 4.0.4</p>
  
  <p><em>I am sharing file uris I got for reference.</em></p>
  
  <p><strong>FILE_URI = content://media/external/images/media/11679</strong></p>
  
  <p><strong>FILE_URI  = file:///mnt/sdcard/Android/data/com.allplugins/cache/1393913804418.jpg</strong></p>
  
  <p><em>I am having error while moving captured image to SD Card.Also I have tried both <code>window.resolveLocalFileSystemURL</code> and <code>window.resolveLocalFileSystemURI</code> but none of them worked for me.</em></p>
  
  <p>and I got error code '1' once I try to move camera captured image to sd card.</p>
  
  <p><em><strong>Error Log</em></strong></p>
  
  <pre><code>&gt; 03-04 12:02:54.482: I/Web Console(27289): Info : got file entry
  &gt; ![object Object] at file:///android_asset/www/js/me/view/demo.js:383
  &gt; 
  &gt; 03-04 12:02:54.482: W/System.err(27289):  at
  &gt; org.apache.cordova.file.FileUtils.access$8(FileUtils.java:583)
  &gt; 
  &gt; 03-04 12:02:54.482: W/System.err(27289):  at
  &gt; org.apache.cordova.file.FileUtils$21.run(FileUtils.java:407)
  &gt; 
  &gt; 03-04 12:02:54.482: W/System.err(27289):  at
  &gt; org.apache.cordova.file.FileUtils$24.run(FileUtils.java:473)
  &gt; 
  &gt; 03-04 12:02:54.482: W/System.err(27289):  at
  &gt; java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
  &gt; 
  &gt; 03-04 12:02:54.482: W/System.err(27289):  at
  &gt; java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
  &gt; 
  &gt; 03-04 12:02:54.482: W/System.err(27289):  at
  &gt; java.lang.Thread.run(Thread.java:856)
  &gt; 
  &gt; 03-04 12:02:54.483: D/IPCThreadState(27289): [DN #5]
  &gt; BR_CLEAR_DEATH_NOTIFICATION_DONE cookie 0x1b36d10
  &gt; 
  &gt; 03-04 12:02:54.574: D/CordovaLog(27289):
  &gt; file:///android_asset/www/js/me/view/demo.js: Line 384 : Error : file
  &gt; move !{"code":1}
  &gt; 
  &gt; 03-04 12:02:54.574: I/Web Console(27289): Error : file move
  &gt; !{"code":1} at file:///android_asset/www/js/me/view/demo.js:384
  </code></pre>
  
  <p><em><strong>My Code</em></strong></p>
  
  <pre><code>function PhotoKeeper() {
  
      var name_of_image = "";
      var pictureSource,destinationType;
      var selectedSourceType;
      var fileSysRoot,projectImageDirectory,projectImageDirectoryName = "temp";
  
      init();
      function init(){
          destinationType = window.Camera.DestinationType;
          pictureSource = window.Camera.PictureSourceType;
  
          window.requestFileSystem(
              LocalFileSystem.PERSISTENT,
              0,
              // got file system sucess callback
              function (arg_o_filesys){
  
                  fileSysRoot = arg_o_filesys.root;
  
                  arg_o_filesys.root.getDirectory(
                      projectImageDirectoryName,
                      {
                          create: true,
                          exclusive: false
                      },
                      // got directory entry sucess callback
                      function(arg_o_directoryEntry) {
                          console.log("Info : got directory entry !");
                          projectImageDirectory = arg_o_directoryEntry;
                      },
                      errorPhoto
                  );
  
              },
              errorPhoto
          );
      }
  
      function getPhotoFromLibreary(){
  
          selectedSourceType = pictureSource.PHOTOLIBRARY;
  
          window.navigator.camera.getPicture(
              gotPhoto,
              errorPhoto,
              { 
                  "quality": 50,
                  "destinationType": destinationType.FILE_URI,
                  "sourceType": selectedSourceType
              }
          );
      }
  
      function getPhotoFromCamera(){
  
          selectedSourceType = pictureSource.CAMERA;
  
          window.navigator.camera.getPicture(
              gotPhoto,
              errorPhoto,
              { 
                  "quality": 50,
                  "destinationType": destinationType.FILE_URI,
                  "sourceType": selectedSourceType
              }
          );
  
      }
  
      function gotPhoto(fileuri){
          window.resolveLocalFileSystemURL(fileuri, gotFileEntry, errorPhoto);
      }
  
      // got fileEntry sucess callback
      function gotFileEntry(arg_o_fileEntry){
          console.log("Info : got file entry !"+arg_o_fileEntry);
          arg_o_fileEntry.copyTo( projectImageDirectory, name_of_image , function(){ console.log("Info : file moved !") } , function(e){ console.log("Error : file move !"+e); } );
      }
  
      function errorPhoto(msg){
          console.log("Error : "+JSON.stringify(msg));
      }
  
      function updateName (argname_of_image) {
  
          if((utils.isUndefined(argname_of_image) === false) &amp;&amp; (typeof argname_of_image == "string")){
              name_of_image = argname_of_image;
          }else{
              name_of_image = Date.now().toString();
          }
  
      }
  
      return{
          getPhotoFromLibreary : function (name_of_image) {
              updateName(name_of_image);
              getPhotoFromLibreary();
          },
          getPhotoFromCamera : function (name_of_image) {
              updateName(name_of_image);
              getPhotoFromCamera();
          }
      }
  }
  </code></pre>