title: Convert blob to image file
body: <p>I am trying to convert an image file captured from an input type=file element without success.  Below is my javascript code</p>
  
  <pre><code>        var img = document.getElementById('myimage');
          var file = document.querySelector('input[type=file]').files[0];
          var reader = new FileReader();
          reader.addEventListener("load", function () {
              var theBlob = reader.result;
              theBlob.lastModifiedDate = new Date();
              theBlob.name = file;
              img.src = theBlob;
              var newfile = new File([theBlob], "c:files/myfile.jpg");
  
          }, false);
  
          if (file) {
              reader.readAsDataURL(file);
          }
  </code></pre>
  
  <p>The image is displayed properly in the img element but the File command does not create the myfile.jpg image file.  I am trying to capture the image and then resizing it using javascript before I upload it to the server.  Anyone know why the image file is not being created?  Better yet, anyone have code on how to resize an image file on the client and then upload it to a server?</p>