$url='http://remote.com/myfile.pdf';
$local='/path/to/local/file.pdf';
file_put_contents($local, file_get_contents($url));
$remoteUrl = "http://remote.com/file.pdf"; $userAgent = 'Googlebot/2.1 (http://www.googlebot.com/bot.html)'; $ch = curl_init($tremoteUrl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_BINARYTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT, $userAgent); $output = curl_exec($ch); $fh = fopen("file.pdf", 'w'); fwrite($fh, $output); fclose($fh);