473,698 Members | 2,344 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 14788

"jerrygarci uh" <de*****@no.spa m.nolaflash.com > wrote in message
news:wu_pb.4071 $In3.3247@laker ead01...
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

"jerrygarci uh" <de*****@no.spa m.nolaflash.com > wrote in message
news:wu_pb.4071 $In3.3247@laker ead01...
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******** ************@sp eakeasy.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

"jerrygarci uh" <de*****@no.spa m.nolaflash.com > wrote in message
news:wu_pb.4071 $In3.3247@laker ead01...
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
3235
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 if fname > 6 print fname Thanks!!!
2
2783
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 webhoster is a real specimen! He/she refuses to provide further support saying it is a script debugging issue*** I need help from ya'll gurus!!!!!! 1a. The path.asp file has only 1 line code: <% = Server.MapPath(".") %>
4
7852
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 injected. If I specify a document-relative path (e.g., src="../someFolder/AnotherFolder/TheGraphic.gif"), then it works fine, but only for documents that exist at the level in the directory structure. I thought I could use a root-relative...
1
5334
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 site root folder (not the curent app folder)? A generic one that works no matter how deep the folder is in the folder heirarchy --
19
10219
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 when I deploy to a remote test server running real IIS, the real root of my application becomes: http://localhost/ What I want to do is have it so that on my local machine the asp.net dev
3
1702
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 application..... so that, when a user types www.myWebSite/subSite, it actualy, shows pages off subweb.
4
7576
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. Thanks,
8
2153
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 the path) and I also used Shell. Does anybody have a snipped showing a more efficient method for launching a Powerpoint file, regardless of which version of Office is running? My current, ineffecient code: Sub main() Try
3
2258
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. localhost:7859/FolderName/filename_that_should_be_in_the_root.aspx this is a pain as I do my links from the root e.g. /css/site.css and the additional folder in the path stops that. Is there any way to get the site in debug mode to show
0
8609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9030
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7738
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6528
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2335
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.