title: Download a file using Javascript
body: <p>There's this Excel file I want users to be able to download from my server. There must be an easy way to initiate the download of the file after a click on the "Download" button... but I have no clue how to make that happen.</p>
  
  <p>I have this so far:  (VBscript and ASP)</p>
  
  <pre><code>&lt;head&gt;
  &lt;script type="text/javascript" src="overzicht.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  Set fs=Server.CreateObject("Scripting.FileSystemObject")
  
      if (fs.FileExists("c:\file.xls"))=true then   'fake filename D:
          response.write("&lt;input type='button' value='Download Masterfile' class='button' onclick='exportmasterfile();' /&gt;&lt;br /&gt;")
      else
          response.write("Masterfile not found. &lt;br /&gt;")
      end if
  
      set fs=nothing
  </code></pre>
  
  <p>The javascript function is empty.</p>