You are here: Re: ftp_fget « PHP Programming Language « IT news, forums, messages
Re: ftp_fget

Posted by John on 07/17/07 15:22

"C." <colin.mckinnon@gmail.com> wrote in message
news:1184593707.079630.37340@n2g2000hse.googlegroups.com...
> On 16 Jul, 11:52, "John" <john1...@yahoo.com> wrote:
>> 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_BINARY);
>>
>> 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_BINARY);

But where has this firewall appeared from? The program was working OK on
both servers.
And I haven't touched anything!

Regards
John

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация