I'm attempting to read a file from a remote server and save it to a
variable. The code below works fine if the remote server is unix based,
but fails with the server I actually need to retrieve data from (NT4 SP4,
beyond my control). When trying to fread from the NT server,
$invoice_contents ends up being null ($invoice_contents === '').
if( !($fd = fopen("anonymous:[EMAIL PROTECTED]/pub/readme.txt", "rb"))){
$error = true;
$error_msg = "Unable to connect to server.";
}
else {
$i = 0;
do {
$invoice_contents = fread($fd, 100000);
$i++;
} while( $invoice_contents == "" && $i < 2 );
fclose($fd);
}
Here's the interesting part: If I comment out the fread and run this
code, there is no visable difference in the ftp logs on the NT server (a
USER, PASS, and sent <path/file> appear for the connection). Am I
correct in interpreting this as the file is being sent immediately (after
the fopen) rather than at the fread? Has anybody else encountered this?
Thanks,
mth
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]