$myFileContents = file_get_contents("http://www.example.com/"); Code (markup): Then use the variable as needed. It will contain the string contents of the file. Make sure this is set in your php.ini file: allow_url_fopen = On Code (markup):
<? $name="abc.zip"; $url="http://www.abc.com/abc.zip"; $ch = curl_init($url); $fp = fopen($name, "w"); curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt ($ch, CURLOPT_TIMEOUT, 12000); curl_exec($ch); curl_close($ch); fclose($fp); ?> PHP: