Re: [PHP] ftp root dir?

2007-05-24 Thread Richard Lynch
On Tue, May 22, 2007 10:19 am, Al wrote:
 I know that; but, I writing a script, that can be used on different
 servers, which creates a directory and I want to
 make certain it is created on the DOC ROOT.  I don't want the user to
 have to test the ftp connection with a ftp utility
 program first.

What you want and how the world actually exists are not matching up...

We cannot fix that...

:-v

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] ftp root dir?

2007-05-24 Thread Richard Lynch
On Tue, May 22, 2007 9:50 am, Al wrote:
 Can I assume that all ftp_connect()s will make the current dir the
 DOC_ROOT?

Probably not.

If I FTP connect to *my* webhosted servers, I'm put into a directory
which contains 'www' and 'php' and 'private' which are set up by the
host for 'DOCUMENT_ROOT' 'include_path' and 'openbase_dir'
respectively, as well as any other directories/files I chose to add
there.

It all depends how FTP and www server are configured, and they are not
tied at the hip by any means.

 If not, how can I insure the ftp root dir is the same as DOC_ROOT?

You'll have to ASK the user to config their own account to map things
up, I guess...

 You can't use the absolute path with ftp.

Again, depends on FPT server and setup -- Some FTP setups accept an
absolute path and allow the FTP user to start at the '/' box root
directory, but not all the time.

 chdir() doesn't change the ftp current dir.

No, it changes the directory on your PHP server box.

 if you ftp_chdir() and it's already on the root, it posts an error.

You should be able to catch that and get rid of it.

 ftp_pwd() simply returns /, which simply says it's on its root,
 where ever that is.

Yes.

That is where it is.

Unless it's been configured to not only have its own root, but also to
change the user to a non-root directory upon login, which is also
possible setup, especially when the user is allowed to run rampant all
over hte box, and the FTP server relies on user/access permissions on
the box to control access.

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] ftp root dir?

2007-05-22 Thread Al
I know that; but, I writing a script, that can be used on different servers, which creates a directory and I want to 
make certain it is created on the DOC ROOT.  I don't want the user to have to test the ftp connection with a ftp utility 
program first.




Jim Moseby wrote:

r?


Can I assume that all ftp_connect()s will make the current 
dir the DOC_ROOT?


If not, how can I insure the ftp root dir is the same as DOC_ROOT?

You can't use the absolute path with ftp.

chdir() doesn't change the ftp current dir.

if you ftp_chdir() and it's already on the root, it posts an error.

ftp_pwd() simply returns /, which simply says it's on its 
root, where ever that is.


The ftp_* functions behave just as any ftp client behaves, AFAIK.  If you
log into the FTP server via your favorite command-line FTP client, you are
seeing the exact same behaviour as the ftp_* functions will see.

JM


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



RE: [PHP] ftp root dir?

2007-05-22 Thread Jim Moseby
r?
 
 
 Can I assume that all ftp_connect()s will make the current 
 dir the DOC_ROOT?
 
 If not, how can I insure the ftp root dir is the same as DOC_ROOT?
 
 You can't use the absolute path with ftp.
 
 chdir() doesn't change the ftp current dir.
 
 if you ftp_chdir() and it's already on the root, it posts an error.
 
 ftp_pwd() simply returns /, which simply says it's on its 
 root, where ever that is.

The ftp_* functions behave just as any ftp client behaves, AFAIK.  If you
log into the FTP server via your favorite command-line FTP client, you are
seeing the exact same behaviour as the ftp_* functions will see.

JM

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



Re: [PHP] ftp root dir?

2007-05-22 Thread Robert Cummings
On Tue, 2007-05-22 at 11:19 -0400, Al wrote:
 I know that; but, I writing a script, that can be used on different servers, 
 which creates a directory and I want to 
 make certain it is created on the DOC ROOT.  I don't want the user to have to 
 test the ftp connection with a ftp utility 
 program first.

You can only do that if you have control over the ftp server settings
such that the FTP directory overlaps your DOC_ROOT at some point. And
even then you need to know exactly how it overlaps since FTP doesn't
expose it's real location to FTP clients (at least not that I know of).

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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