title: How to get wget only save file if its complete
body: <p>I downloading files using wget like this</p>
  
  <pre><code>wget http://www.example.com/mysql.zip -O mysql.zip
  </code></pre>
  
  <p>Then i have do stuff with that file.</p>
  
  <p>But sometimes if there is error in url or somewhere then corrupted file <code>mysql.zip</code></p>
  
  <p>is placed in there and my script don't download the file as its already there and script fails.</p>
  
  <p>Is there any way if <code>mysql.zip</code> is only placed if file download is complete.</p>
  
  <p>There are two cases when that can happen</p>
  
  <ol>
  <li>Url does not exist</li>
  <li>User manually cancels the download</li>
  </ol>
  
  <p>IN both above cases i don't want the file to be there</p>