title: What is the best way to download file from server
body: <p>I have interesting task which requires me to download a dynamically generated file from a server (ASP.NET) to the client. On the client side it is just JavaScript (jQuery) and the client is able to generate a lot of parameters to customize how the data is exported. </p>
  
  <p>What is the best way to do download the file from the server?  Should I use a WCF service such as what is described <a href="http://www.codeproject.com/Articles/166763/WCF-Streaming-Upload-Download-Files-Over-HTTP">here</a> or simple page like <a href="http://shawpnendu.blogspot.com/2009/05/how-to-download-file-from-server-using.html">this one</a>? </p>
  
  <p>I don't know how to download a file without reloading the page (I'm not sure that $.ajax will work in this case). Could someone please give me some direction on this topic? Thanks. </p>