By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,747 Members | 1,701 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,747 IT Pros & Developers. It's quick & easy.

Determining FTP root folder from path?

P: n/a
Hi all,

I have been working on a GUI web photo album for *nix. I had thought it
might be workable for users to
open a browser based FTP session to upload pics to a newly created album
directory. The problem I am having is
opening the FTP session in the new folder. I.E. we have just created
images/myAlbum1. Using realpath(.) we get
/home/someUser/public_html/images/myAlbum1 . Unfortunately the browser
based FTP wants the site root not the server root
and the connection fails.

Is there a reliable way to determine site root from path?

I don't want to regex the path for /www and /public_html, seems like that
would be rash...

Advice?

TIA,

jg
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a

"jerrygarciuh" <de*****@no.spam.nolaflash.com> wrote in message
news:wu_pb.4071$In3.3247@lakeread01...
Hi all,

I have been working on a GUI web photo album for *nix. I had thought it
might be workable for users to
open a browser based FTP session to upload pics to a newly created album
directory. The problem I am having is
opening the FTP session in the new folder. I.E. we have just created
images/myAlbum1. Using realpath(.) we get
/home/someUser/public_html/images/myAlbum1 . Unfortunately the browser
based FTP wants the site root not the server root
and the connection fails.

Is there a reliable way to determine site root from path?

I don't want to regex the path for /www and /public_html, seems like that
would be rash...

Advice?

TIA,

jg


Instaead of using FTP functions, why not just upload it and copy it to the
desired folder?
--
Regards
Richard Grove

http://shopbuilder.org - ecommerce systems
Become a Shop Builder re-seller:
http://www.affiliatewindow.com/affil...ls.php?mid=611
http://www.affiliatewindow.com/a.pl?590


Jul 17 '05 #2

P: n/a
Here's a thought: use ~someUser

You might need to give some thought as to how ~someUser resolves on FTP
versus http?
On http, as you mentioned, it should be: /home/someUser/
Another thought is just to login to FTP and find the corresponding path
prefix for each users home directory, but it sounds like you may have
already investigated this?

I also seconding the other poster's thought about using PHP uploads - keeps
it in the family.

Cheers,

EE

"jerrygarciuh" <de*****@no.spam.nolaflash.com> wrote in message
news:wu_pb.4071$In3.3247@lakeread01...
Hi all,

I have been working on a GUI web photo album for *nix. I had thought it
might be workable for users to
open a browser based FTP session to upload pics to a newly created album
directory. The problem I am having is
opening the FTP session in the new folder. I.E. we have just created
images/myAlbum1. Using realpath(.) we get
/home/someUser/public_html/images/myAlbum1 . Unfortunately the browser
based FTP wants the site root not the server root
and the connection fails.

Is there a reliable way to determine site root from path?

I don't want to regex the path for /www and /public_html, seems like that
would be rash...

Advice?

TIA,

jg

Jul 17 '05 #3

P: n/a
I had consider using PHP file uploads and certainly that could be done. My
thought is that I want to enable my users to batch upload
many images at once and I thought if I could either pop an FTP window or
better yet open one in an I-frame this would make less web-savvy types like
the app better.

Thanks for the replies.

Perhaps I need to ask for the FTP username and password in the application
set up and use them to get ftp_pwd() to give me what I need.

jg
"Eric Ellsworth" <s@n> wrote in message
news:AI********************@speakeasy.net...
Here's a thought: use ~someUser

You might need to give some thought as to how ~someUser resolves on FTP
versus http?
On http, as you mentioned, it should be: /home/someUser/
Another thought is just to login to FTP and find the corresponding path
prefix for each users home directory, but it sounds like you may have
already investigated this?

I also seconding the other poster's thought about using PHP uploads - keeps it in the family.

Cheers,

EE

"jerrygarciuh" <de*****@no.spam.nolaflash.com> wrote in message
news:wu_pb.4071$In3.3247@lakeread01...
Hi all,

I have been working on a GUI web photo album for *nix. I had thought it
might be workable for users to
open a browser based FTP session to upload pics to a newly created album
directory. The problem I am having is
opening the FTP session in the new folder. I.E. we have just created
images/myAlbum1. Using realpath(.) we get
/home/someUser/public_html/images/myAlbum1 . Unfortunately the browser
based FTP wants the site root not the server root
and the connection fails.

Is there a reliable way to determine site root from path?

I don't want to regex the path for /www and /public_html, seems like that would be rash...

Advice?

TIA,

jg


Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.