473,226 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,226 software developers and data experts.

Determining FTP root folder from path?

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
3 14769

"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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: hokiegal99 | last post by:
How would I determine if a filename is greater than a certain number of characters and then truncate it to that number? For example a file named XXXXXXXXX.txt would become XXXXXX fname = files...
2
by: cooldv | last post by:
After talking (emailing) to my webhoster, i have placed my access DB in a folder outside the root directory folder; and they gave me a *path.asp* file to put in my root directory folder. ** This...
4
by: Win, Pats | last post by:
I have a snippet of HTML that I inject into a number of pages throughout my Web site at runtime. My problem is that I'm not getting the image to appear in all documents into which this snippet is...
1
by: John Dalberg | last post by:
I have an asp.net app that is in a folder which is two levels under the website root folder. The website has a login.aspx which is in the root folder. How do I get the relative path to the web...
19
by: Steve Franks | last post by:
I am using VS.NET 2005 beta 2. When I run my project locally using the default ASP.NET Development Web Server it runs using a root address like this: http://localhost:11243/testsite/ However...
3
by: Nalaka | last post by:
Hi, I have an asp.net web application (www.myWebSite), and a subweb application (www.myWebSite/subSite). How do I set it so that, subweb application (www.myWebSite/subSite) be the root...
4
by: Tee | last post by:
Hi, Can anyone tell me how to get the path of IIS root folder from coding? Eg: C:\Inetpub\wwwroot. I would like to detect it via coding as not everyone set it at the default folder. ...
8
by: =?Utf-8?B?R2VvcmdlQXRraW5z?= | last post by:
Greetings! I wrote a small Exe that simply runs Shell to load PowerPoint and launch a particular file, depending on the day of the week. However, it was set up for office 2003 (I naively hardcoded...
3
by: Chris | last post by:
When I go into debug mode and the web page I am working on opens in the browser via the local Cassini Web Server I get a path appended onto the full path e.g. ...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.