Entry
How can I copy a remote file without going through the fopen, fputs stuff?
How can I copy a remote file?
How can I copy a remote binary file?
what if I'm behind a proxy, how do i do the fopen then?
Aug 8th, 1999 23:08
Nathan Wallace, unknown unknown, Sacul, Tomas Vorobjov, Robert Aden
You have to use fopen and fputs to copy a remote file:
function copyFromRemote($remote,$local){
$fp1 = fopen($remote,"r");
$fp2 = fopen($local,"w");
while(!feof($fp1)) {
$line = fgets($fp1, 1024);
fputs($fp2,$line,strlen($line));
}
}
I think that would work but i haven't tested it .....
U should use the following for binary files:
$line = fread($fp1,1024);