title: upload images or videos to remote server using phonegap
body: <p>I am doing project in android phonegap.Here I want to upload images and videos to remote server.
  I used the following link.
  <a href="http://zacvineyard.com/blog/2011/03/upload-a-file-to-a-remote-server-with-phonegap" rel="nofollow">http://zacvineyard.com/blog/2011/03/upload-a-file-to-a-remote-server-with-phonegap</a></p>
  
  <p>I also change some options like options.chunkedMode = false ,android:debuggable="true" and 
  . But still it shows error code 3.I am using the <strong>cordova-2.0.0.js</strong> version.Can anyone suggest some answer.</p>
  
  <p>My js code is</p>
  
  <pre><code>    **
  
  &lt;script type="text/javascript" charset="utf-8"&gt;
  
              // Wait for PhoneGap to load
      document.addEventListener("deviceready", onDeviceReady, false);
  
              // PhoneGap is ready
      function onDeviceReady() {
        // Do cool things here...
              }
  
      function getImage() {
  
                  // Retrieve image file location from specified source
                  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="file";
                  options.fileName=imageURI.substr(imageURI.lastIndexOf('/')+1);
                  options.mimeType="image/jpeg";
  
                  var params = new Object();
                  params.value1 = "test";
                  params.value2 = "param";
  
                  options.params = params;
                  options.chunkedMode = false;
  
                  var ft = new FileTransfer();
                  ft.upload(imageURI, "url of ther server/upload.php", win, fail, options, true);
                  console.log("H");
      }
  
      function win(r) {
                  console.log("HIIIIIiiii");
                  console.log("Code = " + r.responseCode);
                  console.log("Response = " + r.response);
                  console.log("Sent = " + r.bytesSent);
                  alert(r.response);
      }
  
      function fail(error) {
                  alert("There is something");
                  alert("An error has occurred: Code = " + error.code);
      }
  
      &lt;/script&gt;
  </code></pre>
  
  <p>**</p>
  
  <p>and my php code is</p>
  
  <pre><code>&lt;?php
  
  print_r($_FILES);
  $new_image_name = "namethisimage.jpg";
  move_uploaded_file($_FILES["file"]["tmp_name"], "upload/".$new_image_name);
  
  ?&gt;
  </code></pre>
  
  <p>Thanks.</p>