Re: ftp_put() problem??
| From: | Al | Date: | Thu, 24 May 2007 14:16:57 +0000 |
| Subject: | Re: ftp_put() problem?? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-255534@lists.php.net to get a copy of this message | ||
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....