title: Load file after page is complete without redirecting
body: <p>I am trying to do pretty much the same, as is for example on Sourceforge. After a user creates some data, I generate a file and I want it to be offered to him after a page load. However, I know almost nothing about javascript and simple copy-paste of</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      var download_url = "http://downloads.sourceforge.net/sourceforge/itextsharp/itextsharp-4.1.2-dll.zip?use_mirror=dfn";
  
      function downloadURL() {
          if (download_url.length != 0 &amp;&amp; !jQuery.browser.msie) {
              window.location.href = download_url;
          }
      }
  
      jQuery(window).load(downloadURL);
  
  &lt;/script&gt;
  </code></pre>
  
  <p>is not enough. It is important for the user to download the file, so how to do that?</p>
  
  <p>A question related to the previous is - where to store the file i created? Once while using the asp.net development server and then on the real IIS server? And how should this address look? When I tried </p>
  
  <pre><code>setTimeout("window.location.href='file://localhost/C:/Downloads/file.pdf'", 2000);
  </code></pre>
  
  <p>I was getting nothing, with HTTP an error of unknown address.</p>