Great question — answering as the UphillTech team:
The problem is you are trying to get access of file directly from web page which is not possible. You cannot access any file outside of you browser. For that you have to select the input element of html and after getting the file data you can store it to javascript variable. <script src="alasql.min.js"></script> <script src="xlsx.core.min.js"></script> <p>Select CSV file to read:</p> <input id="readfile" type="file" onchange="loadFile(event)"/> <script> function loadFile(event) { alasql('SELECT * FROM FILE(?,{headers:true})',[event],function(data){ console.log(data); // You can data to div also. }); } </script>
Full answer by Sarjan Desai: https://stackoverflow.stackexchange.com/a/32648446 (CC BY-SA 3.0).
Need it done for your business? UphillTech.