which is the best way to download from php large files without consuming all server's memory?
I could do this (bad code):
$url='http://server/bigfile';
$cont = file_get_contents($url);
file_put_contents('./localfile',$cont);
This example loads entry remote file in $cont
and this could exceed memory limit.
Is there a safe function (maybe built-in) to do this (maybe stream_*)?
Thanks