title: Servlet: Force Browser (Google Chrome) to Open 'Save As' Dialog Immediately
body: <p>I have a servlet (Java EE) that returns a large pdf file to UI/browser(HTML &amp; JavaScript) for download. It takes the server 10-20 seconds to generate the file so I am trying to pop up the save as dialog ASAP to avoid browser lag, user confusion, wait and so on.</p>
  
  <p>I only want to send headers etc. just to make connection, when server has its work done we flush the rest of payload.</p>
  
  <p>I send  immediately after headers and flush buffer. this works well in firefox and the browser shows the dialog thus eliminating the browser wait and creates the illusion that download has started,,, this does not work for chrome.</p>
  
  <p>Any help appreciated.</p>