title: Convert an img to file and back in Javascript
body: <p>Imagine a web page has an <em>img</em> tag which needs to be uploaded. How do I convert this to a file object, so that I can send it over?</p>
  
  <p>And on the other end, I have the hypothetical img, converted to file and sent to me. How do I convert this to a HTML tag?</p>
  
  <p>I have an initial starting point for the latter part:</p>
  
  <pre><code>imageUrl = URL.createObjectURL(file);
  image = document.createElement("img");
  image.src = imageUrl;
  </code></pre>