title: How can i upload an image to a node js server without a form?
body: <p>I have an express server running and I want to upload an image (<code>&lt;input type="file"&gt;</code>) without the html <code>&lt;form&gt;</code> tag. Is this even possible?</p>
  
  <p>I use this function to get the file from the input when its value has changed:</p>
  
  <pre><code>function readImage (input) {
    var _URL = window.URL || window.webkitURL;
    if (input.files &amp;&amp; input.files[0]) {
      var myImg = new Image();
      myImg.onload = function () {
        var img = {
          image: myImg.src,
          file: input.files[0],
          w: this.width,
          h: this.height
        };
        return img;
      };
      myImg.src = _URL.createObjectURL(input.files[0]);
    }
  }
  </code></pre>