( !filein.files ) {
      document.getElementsByTagName('p')[0].innerHTML = 'FAIL - file API is not supported.';
      return;
    }
    if( !filein.files[0] ) {
      document.getElementsByTagName('p')[0].innerHTML = 'FAIL - no file was found in the file input.';
      return;
    }
    var thefile = filein.files[0];
    try {
      e.dataTransfer.items.add(thefile);
    } catch(err) {
      document.getElementsByTagName('p')[0].innerHTML = 'FAIL - error when adding file';
      e.preventDefault();
      r