Quick Search:
 
 PHP Code: Copy a remote file to your site Jump to:  
Category: >> PHP Code >> Copy a remote file to your site  

<< lastnext >>

Snippet Name: Copy a remote file to your site

Description: Copies any file (image, zip, swf, etc) from a remote site to a file on your site.

Also see:
» Saving Remote Images With PHP
» Copy a remote file to your site
» Random Image from Directory
» Read gzip File
» Create gzip file
» Simple image scaling
» Show current time as PNG-image
» Check if an image exists (GD)
» Gradient Image Generator
» Show basic image info
» Write text onto an image
» Remote file_exist()
» Storing images in a database
» Make grayscaled image
» CAPTCHA with GD Image Library
» Calculate Zipcode Distances

Comment: (none)

Language: PHP
Highlight Mode: PHP
Last Modified: March 16th, 2009

FUNCTION copy_file($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;
	}
}


 
   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org