RE: [PHP] ftp_get, ftp_put problem

From: Date: Fri, 20 Jan 2006 14:17:07 +0000
Subject: RE: [PHP] ftp_get, ftp_put problem
Groups: php.general 
Request: Send a blank email to php-general+get-228938@lists.php.net to get a copy of this message
[snip] 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 ? [/snip] You may have to set the passive mode, see http://us2.php.net/manual/en/function.ftp-pasv.php

« previous php.general (#228938) next »