Re: ftp_put() problem??

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Can anyone explain what's going on.  This works; but, I don't understand it.

Two folks pointed out I had my $remote and $local files reversed. I fixed that; but, it still didn't work.

This does work:

$source_dir is the absolute path i.e., /home/xxxxx/public_html/EditPage

ftp_chdir($dist_dir);  //$dist_dir is simply relative to $_SERVER[document_root]; i.e., /test

ftp_put($conn_id, $dist, $source, flag];


Al wrote:
Can anyone help with this.  On a Linux/Apache server.

I want to simply copy a file with ftp_put() from one dir to another.

To make certain I'm pointing to the correct dirs, I'm using this:
print_r(ftp_nlist($conn_id, FTP_EP_DIR)); //It is the correct dir
print_r(ftp_nlist($conn_id, $rpdir));   //It is the correct dir

Then I'm:
ftp_put($conn_id, FTP_EP_DIR .'/' . $file, $rpdir. '/' . $file, FTP_ASCII);

Error msg:
Warning: ftp_put(/home/xxxxx/public_html/test/EditPageIndexer.php) [function.ftp-put]: failed to open stream: No such file or directory in /home/xxxxx/public_html/EditPage/ep_functions.inc on line 227

And the files are not copied.

Owner and permissions are correct. I can make a new dir [mkdir()] in the destination dir without a problem.

Manual is confusing when it calls the files "remote" and "local".

Thanks....

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux