Copy a remote file to your site



کد PHP:


FUNCTION copy_file($url,$filename){
  
    
$file FOPEN ($url"rb");
  
    IF (!
$file) RETURN FALSE; ELSE {
        
$fc FOPEN($filename"wb");
  
        WHILE (!
FEOF ($file)) {
            
$line FREAD ($file1028);
            
FWRITE($fc,$line);
        }
  
        
FCLOSE($fc);
        RETURN 
TRUE;
    }