$timeout)) { $f = fopen($cached_name, "wb"); flock($f, LOCK_EX); $ch = curl_init($url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_FILE, $f); curl_exec($ch); curl_close($ch); fclose($f); } $f = fopen($cached_name, "rb"); flock($f, LOCK_SH); $retval = fread($f, filesize($cached_name)); fclose($f); return $retval; } if (strlen($url) > 0) { $filename = explode("/", $url); header('Content-type: application/octet-stream'); header('Content-Disposition: attachment; filename="' . urldecode($filename[sizeof($filename) - 1]) . '"'); print_r(get_remote_file($url)); } else { ?> File Downloader

File Downloader

Please enter the URL of a file to download.