title: upload / POST file with html5 / ajax / javascript without using form and <input type=file>
body: <p>I need to upload a file to a server in post without using a form or even a  tag.</p>
  
  <p>The reason is because i'm working on a web app for a mobile device and the file sections is done via the integrated gallery app. It returns me only the path to the picture on the device file system.</p>
  
  <p>I assume this may be done by reading the filecontent, putting it in a blob and using a FormData object ? Something like :</p>
  
  <pre><code>var oMyForm = new FormData();
  
  oMyForm.append("id", "foo");
  oMyForm.append("user", "bar");
  
  var oFileBody = someFileReadingFunction("/path/to/picture"); // I think this should be some custom javascript call specific from the device.
  var oBlob = new Blob([oFileBody], { type: "image/jpg"});
  
  oMyForm.append("mypicture", oBlob);
  
  var oReq = new XMLHttpRequest();
  oReq.open("POST", "http://foo.com/submitform.php");
  oReq.send(oMyForm);
  </code></pre>
  
  <p>I'm right or i'm I looking in the wrong direction ?</p>
  
  <p>Best regards</p>