title: Downloading large files with R/RCurl efficiently
body: <p>I see that many examples for downloading binary files with RCurl are like such:</p>
  
  <pre><code>library("RCurl")
  curl = getCurlHandle()
  bfile=getBinaryURL (
          "http://www.example.com/bfile.zip",
          curl= curl,
          progressfunction = function(down, up) {print(down)}, noprogress = FALSE
  )
  writeBin(bfile, "bfile.zip")
  rm(curl, bfile)
  </code></pre>
  
  <p>If the download is very large, I suppose it would be better writing it concurrently to the storage medium, instead of fetching all in memory.</p>
  
  <p>In RCurl documentation there are some examples to get files by chunks and manipulate them as they are downloaded, but they seem all referred to text chunks.</p>
  
  <p>Can you give a working example?</p>
  
  <h2>UPDATE</h2>
  
  <p>A user suggests using the R native <code>download file</code> with <code>mode = 'wb'</code> option for binary files. </p>
  
  <p>In many cases the native function is a viable alternative, but there are a number of use-cases where this native function does not fit (https, cookies, forms etc.) and this is the reason why RCurl exists.</p>