"C." <co************@gmail.comwrote in message
news:11*********************@n2g2000hse.googlegrou ps.com...
On 16 Jul, 11:52, "John" <john1...@yahoo.comwrote:
>Hi
There is an odd problem.
The following works fine on one web server, but the same code hangs on a
different server.
I can login but the problem is at the following line.
$down=ftp_fget($connect,$handle,$remotefile,FTP_B INARY);
Any ideas why this is happening?
FTP uses a second connection for data (first connection used for
control) which can cause problems with firewalls. Try using passive
mode (ftp_pasv())
HTH
C.
You're right. I added the ftp_pasv and we're working again.
$login=ftp_login($connect,$user,$pass);
if (!$login) die ("Unable to login." . $lf . $dot);
ftp_pasv($connect,true);
$down=ftp_fget($connect,$handle,$remotefile,FTP_BI NARY);
But where has this firewall appeared from? The program was working OK on
both servers.
And I haven't touched anything!
Regards
John