title: wait for Download complete
body: <p>I need to download a zip file created in realtime from a webservice.
  Let me explain.
  I am developing a web application that uses a SoapXml webservice. There is the Export function in the webservice that returns a temporary url to download the file. Upon request to download, the server creates the file and makes it available for download after a few seconds.
  I'm trying to use</p>
  
  <blockquote>
    <p>webClient.DownloadFile(url, @"c:/etc../")</p>
  </blockquote>
  
  <p>This function downloads the file and saves it to me 0kb. is too fast! The server does not have time to create the file. I also tried to put</p>
  
  <blockquote>
  <pre><code>webClient.OpenRead(url); 
  System.Threading.Thread.Sleep(7000);
  webClient.DownloadFile(url, @"c:/etc../");
  </code></pre>
  </blockquote>
  
  <p>but does not work.
  In debug mode if I put a BREAK POINT on webClient.DownloadFile and I start again after 3, 4 seconds, the server have the time to create the file and I have a full download.</p>
  
  <p>The developers of the webservice suggested me to use "polling" on the url until the file gets ready for the download. how does it work?</p>
  
  <p>How can I do to solve my problem? (I also tried to DownloadFile Asynchronous mode )</p>