Return to Snippet

Revision: 22575
at January 16, 2010 08:34 by ginoplusio


Initial Code
function copyFile($url,$filename){
	$file = fopen ($url, "rb");
	if (!$file) return false; else {
		$fc = fopen($filename, "wb");
		while (!feof ($file)) {
			$line = fread ($file, 1028);
			fwrite($fc,$line);
		}
		fclose($fc);
		return true;
	}
}

Initial URL
http://www.barattalo.it/2010/01/16/copying-remote-files-on-your-server-with-php/

Initial Description
Used to copy the user avatar from Facebook to your community in this [Facebook Connect Tutorial](http://www.barattalo.it/facebook-connect-tutorial/ "Tutorial").

Initial Title
Copy remote JPG on your site with PHP

Initial Tags
php, copy

Initial Language
PHP