<html> <head> <input type="file" id="fileinput" /> <script type="text/javascript"> function readSingleFile(evt) { var reader = new FileReader(); reader.onload = function(event) { var contents = event.target.result; console.log("File contents: " + contents); }; reader.onerror = function(event) { console.error("File could not be read! Code " + event.target.error.code); }; reader.readAsText(file); </script> </head> <body> <input type='file' accept='text/plain' onchange='readSingleFile(evt)'><br> <div id="output"> ... </div> </body> </html></br>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)