473,394 Members | 1,674 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,394 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 14778

"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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.