title: Warning "downloaded length != reported length" in installing packages from CRAN
body: <p>Searching on stackoverflow questions, I found out this link:
  <a href="https://stackoverflow.com/questions/13652001/error-in-file-download-when-downloading-custom-file">Error in file.download when downloading custom file</a> .</p>
  
  <p>However, my case is a little bit different (I think):</p>
  
  <p>1) I get this annoying warning when installing some packages from CRAN (or also just some dependencies that get generally installed together with the required package).</p>
  
  <p>2) The downloaded length always appear to be equal to the reported length, so there should be no warning.<br>
  As an example, I copy-paste here the warning that has just appeared in updating <code>mgcv</code>.</p>
  
  <pre><code>Warning message:
  In download.file(url, destfile, method, mode = "wb", ...) :
    downloaded length 1886962 != reported length 1886962
  </code></pre>
  
  <p>The <code>mode</code> argument is already set to "wb", so the solution offered in the SO link does not seem to work.</p>
  
  <p>It is very strange, because I have re-installed both R and RStudio recently for other reasons, but this warning has not desappeared.</p>
  
  <p>Any advise is welcome.</p>