[ ilija666 @ 23.05.2012. 14:52 ] @
pokusavao sam sa ova dva nacina, ali sve sto dobijam je prazan fajl u folderu na serveru. folder ima dovoljne dozvole za upis. function save_image($inPath,$outPath) Code: { //Download images from remote server $in= fopen($inPath, "rb"); $out= fopen($outPath, "wb"); while ($chunk = fread($in,8192)) { fwrite($out, $chunk, 8192); } fclose($in); fclose($out); } save_image('http://www.php.net/images/php.gif','image.gif'); i function download_remote_file($file_url, $save_to) { $content = file_get_contents($file_url); file_put_contents($save_to, $content); } download_remote_file('http://www.php.net/images/php.gif', realpath("./downloads") . '/file.gif'); |