title: Cordova - how to upload captured image by Camera.getPicture to server
body: <p>I have following code, which takes picture and save image into DCIM/Camera/filename/ on Android.My question is how to upload this file onto server like ocr.space, by using <strong>formData</strong>.My code says <strong>No file uploaded or URL provided</strong>, which means im not giving file, but only path to location.Ive tried this in windows too with no success.So whats the correct way to upload file from local path?When i use URL like form.append("url", url ) instead of local path, its working properly.<strong>I would like to say that im not able to use file input</strong> , because its cant be filled dynamiccaly for security reasons so user must choose file and i want to send it automatically.</p>
  
  <pre><code>function capturePhoto() {
      navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 50 });
  }
  
  function onPhotoDataSuccess(imageData) {                
      temppath = imageData;
  
  
  var form = new FormData();
  
  form.append("apikey", "xxxxxxxxxxxxxx");
  form.append("language", "Czech");
  form.append("isOverlayRequired", "true");
  form.append("file", temppath );
  
  
  
  var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.ocr.space/parse/image",
    "method": "POST",
    "headers": {
      "cache-control": "no-cache",
      "postman-token": "01872f0e-7d67-3210-9929-13696ed792c7"
    },
    "processData": false,
    "contentType": false,
    "mimeType": "multipart/form-data",
    "data": form
  }
  
  $.ajax(settings).done(function (response) {
    console.log(response);
  }); 
  
  
  }
  
  function onFail(message) {
      alert('Failed to load picture because: ' + message);
  }
  </code></pre>