title: HTML 5 File upload event
body: <p>I am trying to upload a file using the HTML File Api but I really seem not to get how to do it. What event do I have to give to the getImg() function? </p>
  
  <p>HTML</p>
  
  <pre><code>&lt;input id='img' type='file' onchange='getImg(event)'/&gt;
  </code></pre>
  
  <p>JS</p>
  
  <pre><code>function getImg(evt){
   var files = evt.dataTransfer.files;
   var file = files[0];
  console.log(file.name)
  </code></pre>