You are here: Re: [PHP] ftp_get, ftp_put problem « PHP « IT news, forums, messages
Re: [PHP] ftp_get, ftp_put problem

Posted by "Richard Lynch" on 01/20/06 23:41

On Fri, January 20, 2006 7:26 am, Antonis Varkas wrote:
> I am writing a php script to upload/download a file onto/from an FTP
> Server. I manage to connect to the server, login correctly, change
> directory, list all the files there but fail to get or put the file.
> The documentation says that ftp_get and ftp_put return TRUE or FALSE.
> In
> my case nothing at all is returned.
>
> Using the following code part, the $test variable is empty
>
> // upload the file
> $test = ftp_put($conn_id, $remote_file, $local_file, FTP_BINARY);
> if ($test) {
> echo "Successfully uploaded $local_file.\n";
> } else {
> echo "There was a problem while uploading $local_file.\n";
> echo("TEST: ".$test."\n<br/>");
> }
> I don't get any warnings.
> Does this indicate something I can't figure out ?

FTP active/passive setting changes whether FTP tries to open up a
second connection back to your computer to put/get the actual file
contents, leaving the original connection for you to send more
commands etc.

If your firewall doesn't allow that second connection to happen, then
you may encounter this phenomenon.

Try switching active/passive around and see what you get.

--
Like Music?
http://l-i-e.com/artists.htm

 

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

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