Answers for "how to get content from file in html input"

3

js fileinput get content

//get file object
var file = document.getElementById('myFile').files[0];
if (file) {
  // create reader
  var reader = new FileReader();
  reader.readAsText(file);
  reader.onload = function(e) {
    // browser completed reading file - display it
    alert(e.target.result);                     
  };
}
Posted by: Guest on November-25-2021
0

html get text from file

<embed src="file.txt"> // This will show the text contained in file.txt in the page
Posted by: Guest on November-14-2020

Code answers related to "how to get content from file in html input"

Browse Popular Code Answers by Language