Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

filereader reactjs

// Callback from a <input type="file" onchange="onChange(event)">
function onChange(event) {
  var file = event.target.files[0];
  var reader = new FileReader();
  reader.onload = function(event) {
    // The *.txt file text will be printed here
    console.log(event.target.result)
  };

  reader.readAsText(file);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #filereader #reactjs
ADD COMMENT
Topic
Name
6+5 =