title: Get img from DOM and upload it via ajax
body: <p>How can I get an image from DOM and then upload it via ajax? </p>
  
  <pre><code>my_img_ele = document.getElementById("my_img");
  </code></pre>
  
  <p>This is the ajax call</p>
  
  <pre><code>    var xmlHttp=new XMLHttpRequest();
      xmlHttp.open("POST", "site", true);
      var formData = new FormData();  
      formData.append(IMG_HERE); 
      xmlHttp.send(formData);
  </code></pre>
  
  <p>What I have been doing is just sending the url and then looking up the image server side. But I figure this will be quicker.</p>
  
  <p>EDIT: Note that the user is not uploading an image via a form. It's an img element.</p>