title: Get the file name and the extension while uploading file in PhoneGap
body: <p>I am uploding an image from a gallery using <em>PhoneGap</em> in Android but what I want to do is to fetch the file name and its extension which i am not be able to get it from <em>imageuri</em> so can any one tell me how can I find one </p>
  
  <p>my <code>imageURI</code> is <code>content://media/external/images/media/876</code> so is there a way to get a fileEntry by using this <code>imageURI</code> and read the file name and extension ? </p>
  
  <pre><code>function fileUpload(){
  
      navigator.camera.getPicture(
                  uploadPhoto,
                  function(message) { alert('get picture failed'); },
                  {
                      quality         : 50,
                      destinationType : navigator.camera.DestinationType.FILE_URI,
                      sourceType      : navigator.camera.PictureSourceType.PHOTOLIBRARY
                  }
              );
  
  
     }
      function uploadPhoto(imageURI) {
              var options = new FileUploadOptions();
              options.fileKey="uploaded_file";
              alert(imageURI);
              options.fileName=imageURI.substr(imageURI.lastIndexOf('/')+1);
              options.mimeType="image/jpeg";
  
              var params = new Object();
              params.value1 = "test";
              params.value2 = "param";
  
              options.params = params;
  
              var ft = new FileTransfer();
              ft.upload(imageURI, encodeURI("http://www.mydomain.com/mobile_upload.php"), win, fail, options);
          }
  
          function win(r) {
  
              alert("WIN" +r.response);
              console.log("Code = " + r.responseCode);
              console.log("Response = " + r.response);
              console.log("Sent = " + r.bytesSent);
          }
  
          function fail(error) {
  
                      alert("error");
  
              alert("An error has occurred: Code = " + error.code);
              console.log("upload error source " + error.source);
              console.log("upload error target " + error.target);
          } 
  </code></pre>