There's too many code snippets on the Internet on how to do this, but not enough libraries. This will allow you to download files of any size using cURL without ever running out of memory. That's it.