title: Open Excel file instead of download using HTML and Javascript
body: <p>Can anyone please suggest any idea about how to open an Excel file, kindly check below code and let me know how to achieve opening the instead of downloading the file.</p>
  <pre><code>&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
  &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
  &lt;head&gt;
  &lt;script type=&quot;text/javascript&quot;&gt;
  
  function read()  
  {  
       var txtFile = new XMLHttpRequest();  
       txtFile.open(&quot;GET&quot;, &quot;C:\Users\user-temp\Downloads\test.xlsx&quot;, true);  
       txtFile.onreadystatechange = function()   
       {  
            if (txtFile.readyState === 4)   
            {  
                 // Makes sure the document is ready to parse.  
                 if (txtFile.status === 200)   
                 {  
                      // Makes sure it's found the file.  
                      document.getElementById(&quot;div&quot;).innerHTML = txtFile.responseText;  
                 }  
            }  
       }  
       txtFile.send(null)  
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body onload=&quot;read();&quot;&gt;  
  &lt;form id=&quot;form1&quot; runat=&quot;server&quot;&gt;  
     &lt;div id=&quot;div&quot;&gt;  
     &lt;/div&gt;  
  &lt;/form&gt;  
  </code></pre>