Re: [PHP] Question about using ftp_put() for copying files
- From: news@xxxxxxxxxxxxx (Al)
- Date: Thu, 24 May 2007 18:04:36 -0400
What puzzles me is that one path must be absolute and the other relative to the root. And, I've got chdir to the destination dir.
I know about ftp having its own root. In my code, I have a check to make certain the ftp root is the same as the $_SERVER[document_root].
Richard Lynch wrote:
.
On Thu, May 24, 2007 2:37 pm, Al wrote:Can anyone explain what's going on.
If I assign $source= $source_dir . $file;
$source_dir is the absolute path i.e.,
/home/xxxxx/public_html/EditPage/
And $dist= $dist_dir . $file;
$dist_dir is simply relative to $_SERVER[document_root]; i.e., just
plain /test
To get ftp_put() to work, I must first chdir to the $dist_dir.
ftp_chdir($dist_dir);
ftp_put($conn_id, $dist, $source, flag];
Similar to 'document_root', FTP has its own idea of where a "root"
directory is for each login/user.
In your case, it would appear by coincidence to match up with
'document_root' -- well, perhaps not "coincidence" since many webhosts
restrict their users' FTP accounts to only be their own web
directories, so they can't go poking around in other people's stuff
quite as easily.
- References:
- Question about using ftp_put() for copying files
- From: Al
- Re: [PHP] Question about using ftp_put() for copying files
- From: "Richard Lynch"
- Question about using ftp_put() for copying files
- Prev by Date: System log in problems
- Next by Date: Re: [PHP] Include file questions
- Previous by thread: Re: [PHP] Question about using ftp_put() for copying files
- Next by thread: Did I find a bug in PHP 5.2.2?
- Index(es):
Relevant Pages
|
Loading