onerror

Ā 

// Callback from a <input type="file" onchange="onChange(event)">
function onChange(event) {
  var file = event.target.files[0];
  var reader = new FileReader();
  reader.onerror = function(event) {
    reader.abort();
  };

  reader.readAsText(file);
}