title: SheetJS - Trying to read excel file based on drop down list
body: <p>I have a drop down that consist of list of uploaded excel files. I can retrieve the file path any time. What I'm trying to do is, when user selected one of the file name listed in the drop down, I will use javascript to get the physical file and pass to the SheetJS code to read and process the file.</p>
  
  <p>Here is the code I'm struggling with :</p>
  
  <pre><code>function handleFile(e) {
          rABS = document.getElementsByName("userabs")[0].checked;
          use_worker = document.getElementsByName("useworker")[0].checked;
          var files = e.target.files; // &lt;--- trying to modify this part
          var f = files[0];
          {
              var reader = new FileReader();
              var name = f.name;
              reader.onload = function (e) {
              .....
  </code></pre>
  
  <p>According to the original code from SheetJS, the file is retrieved by either an upload input file type or drag-and-drop. In that case, the file can be stored into FileList object and retrieved in the event above. The code above is called when user selected a file in the input file. </p>
  
  <p>But in my case, I can't dynamically add into FileList object because the files are in the drop down. </p>
  
  <p>I'm looking some work around to dynamically add file into the input file so that the file can be stored into FileList object. I'm still searching for solution but I'm doubting if that would work.</p>
  
  <p>So I like to seek any good advice on how to get the single user selected file from the drop down and send to the code above for the FileReader to read. </p>
  
  <p>Here is the SheetJS Demo and code files:</p>
  
  <p><a href="http://oss.sheetjs.com/js-xlsx/" rel="nofollow">SheetJS Demo site</a></p>
  
  <p><a href="https://github.com/SheetJS" rel="nofollow">SheetJS Github</a></p>
  
  <p>Thank you</p>