FTP fails even though the warning says successful?



Hi,

I'm using PHP 4.4.4 with Apache 2 on Fedora Core 5. I can use a normal
FTP client to successfully reach an FTP server, but when I execute the
following code, I fail with this error

Warning: ftp_put() [function.ftp-put]: Failed to establish connection.
in /usr/local/apache2/htdocs/super_admin_rs/sa_prod_fns.php on line 96
FTP upload has failed!

Here's the code

// set up basic connection
$conn_id = ftp_connect($ftp_host);
if ($conn_id) {
// login with username and password
$login_result = ftp_login($conn_id,
$ftp_user, $ftp_pwd);
if ($login_result) {
// Disable passive mode
ftp_pasv($conn_id, false);

// upload the file
$remote_path = "$ftp_dir/" .
SQL_PRODUCT_SHORT_FILE_NAME;
ftp_delete($conn_id,
$remote_path);
$upload = ftp_put($conn_id,
$remote_path, $sql_file_path, FTP_ASCII);

// check upload status
if (!$upload) {
die("FTP upload has
failed!");
}

What am I doing wrong?

Thanks, - Dave

.



Relevant Pages

  • Re: FTP Upload Woes
    ... *Configure FTP*, ... > An FTP upload that was successful prior to installation of ISA Server 2004 ... > high range port, which I have blocked. ... > different ports that the FTP server is trying to respond to. ...
    (microsoft.public.isa.configuration)
  • Re: Publisher and 1&1
    ... In other words, clean up the folder. ... change the FTP proxy settings to allow ... To use Publisher read the following ... this is your root directory and where you upload your Publisher ...
    (microsoft.public.publisher.webdesign)
  • Re: hmt will not load in FTP client after proxy server problems.
    ... Publisher is a DTP with limited web building capability. ... Now as per the FTP issue. ... off the server, and upload new ones. ... index.htm file and the index_files folder that contain the supporting ...
    (microsoft.public.publisher.webdesign)
  • Re: hmt will not load in FTP client after proxy server problems.
    ... what things you have to format differently when you build a webpage. ... Now as per the FTP issue. ... off the server, and upload new ones. ... index.htm file and the index_files folder that contain the supporting ...
    (microsoft.public.publisher.webdesign)
  • Re: Publisher and 1&1
    ... change the FTP proxy settings to allow access ... To use Publisher read the following article: ... I do that the destination menu greys out. ... 1&1 is not really clear about how and where to upload your files. ...
    (microsoft.public.publisher.webdesign)