/**
* cURL file copy to another server
* This file saved my life when i had to let a file upload synchrom to a different server, no ftp messing around!
*/
$rCurl = curl_init();
/**
* The file to copy
*/
curl_setopt($rCurl, CURLOPT_URL, 'http://www.google.nl/intl/nl_nl/images/logo.gif');
/**
* cURL options dunno what for
*/
curl_setopt($rCurl, CURLOPT_HEADER, false);
/**
* cURL options dunno what for
*/
curl_setopt($rCurl, CURLOPT_BINARYTRANSFER, true);
/**
* cURL options dunno what for
*/
curl_setopt($rCurl, CURLOPT_RETURNTRANSFER, true);
/**
* The php file limit
*/
set_time_limit(300);
/**
* set cURL timeout
*/
curl_setopt($rCurl, CURLOPT_TIMEOUT, 300);
/**
* The file that will be written
*/
$rOutPut = fopen('googlelogo.gif', 'wb');
/**
* Setup the transfer ?
*/
curl_setopt($rCurl, CURLOPT_FILE, $outfile);
/**
* Execute the transfer
*/
curl_exec($rCurl);
/**
* Close the file
*/
fclose($rOutPut);
/**
* Close cURL
*/
curl_close($rCurl);