PHP

PHP CURL FILE DOWNLOAD

CURL FILE DOWNLOAD

FILE HANDLER $fh = fopen("FILE", "w");   CURL INIT $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "HTTP://SITE.COM/FILE"); curl_setopt($ch, CURLOPT_FILE, $fh);   CURL RUN curl_exec($ch); if (curl_errno($ch))   { echo curl_error($ch); } else { echo "OK"; }   CLOSING UP curl_close($ch); fclose($fh);

EXTRA - SIMPLE DOWNLOAD

WE DON'T NEED CURL ACTUALLY. $source = "HTTP://SITE.COM/FILE"; $destination = "FILE";  file_put_contents(   $destination,   file_get_contents($source) );