title: Javascript: Open excel file on browser side
body: <p>I'm new here. If I'm doing something wrong just tell me. Thanks ;)</p>
  
  <p><strong>My Problem:</strong> I need to open an excel file from the client. The user has to choose a file in a form in HTML or JS and then JS needs to open this file and parse it. This fiddle is a good example: </p>
  
  <pre><code>http://jsfiddle.net/3ve90afo/
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;input id="readfile" type="file" onchange="loadFile(event)"/&gt;
  &lt;xmp id="output"&gt;&lt;/xmp&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>print('AlaSQL v'+alasql.version)
  print('Please upload txt, json, csv, tsv, tab, xlsx, xls or html file to see the content')
  
  loadFile = function(event) {
      alasql('SELECT * FROM FILE(?,{headers:true})',[event],function(data){
          print(data)
      });
  }
  
  function print(x){
      document.getElementById('output').textContent += JSON.stringify(x,  null, '\t')+"\n";
  }
  </code></pre>
  
  <p>So, alaSQL seemed good and easy for this problem. But the above code always comes to this error:</p>
  
  <pre><code>Uncaught TypeError: path must be a string or Buffer
      at Object.fs.readFile (fs.js:274:11) ....
  </code></pre>
  
  <p>I didn't find any answer to this error in the web. So, is there another possibility to do this or a way to fix this error?</p>