function readFile(input) { alert(input); let file = input.files[0]; let reader = new FileReader(); reader.readAsText(); reader.onload = function() { console.log(reader.result); }; reader.onerror = function() { console.log(reader.error); }; }
Quote:The FileReader object lets web applications asynchronously read the contents of files (or raw data buffers) stored on the user's computer, using File or Blob objects to specify the file or data to read.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)