473,883 Members | 1,656 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Listing aliased directory

xEM
I have in Apache2 (win32) aliased directory, for example:

Alias /ftp/mp3/ "D:/mp3/"
<Directory "D:/mp3">
....
</Directory>

Address to this directory will be: http://localhost/ftp/mp3/

How can i list files in that directory?

# This works for full-path directory on my hdd, but not for aliased:
if ($handle = opendir($direct ory)) {
while (false !== ($file = readdir($handle ))) {
if ($file != "." && $file != "..") {
echo "$file\n";
}
}
closedir($handl e);
}
--
pozdr.
xEM~
Jul 17 '05 #1
3 2546
On Sat, 22 Nov 2003 09:53:58 +0000 (UTC), xEM <xe**@boxmail.b iz> wrote:
I have in Apache2 (win32) aliased directory, for example:

Alias /ftp/mp3/ "D:/mp3/"
<Directory "D:/mp3">
...
</Directory>

Address to this directory will be: http://localhost/ftp/mp3/

How can i list files in that directory?

# This works for full-path directory on my hdd, but not for aliased:
if ($handle = opendir($direct ory)) {
while (false !== ($file = readdir($handle ))) {
if ($file != "." && $file != "..") {
echo "$file\n";
}
}
closedir($handl e);
}


You can use apache_lookup_u ri to translate the URL into a filesystem path.

http://uk2.php.net/manual/en/functio...lookup-uri.php

--
Andy Hassall (an**@andyh.co. uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Jul 17 '05 #2
xEM
Andy Hassall <an**@andyh.co. uk> wrote in
news:2p******** *************** *********@4ax.c om:
You can use apache_lookup_u ri to translate the URL into a filesystem
path.

http://uk2.php.net/manual/en/functio...lookup-uri.php


It works well on Apache 1.3 but not on 2.0 :(

http://rok.codeartists.com/projects/digital_archive/

--
pozdr.
xEM~
Jul 17 '05 #3
On Sat, 22 Nov 2003 15:54:59 +0000 (UTC), xEM <xe**@boxmail.b iz> wrote:
Andy Hassall <an**@andyh.co. uk> wrote in
news:2p******* *************** **********@4ax. com:
You can use apache_lookup_u ri to translate the URL into a filesystem
path.

http://uk2.php.net/manual/en/functio...lookup-uri.php


It works well on Apache 1.3 but not on 2.0 :(

http://rok.codeartists.com/projects/digital_archive/


Works fine for me on PHP 4.3.3, Apache 2.0.44. What problem are you having?

<pre>
<form action="" method="get">
<input type="text" name="url" value="<?php echo
htmlentities(@$ _GET['url']);?>" />
<input type="submit" />
</form>
<?php
if (isset($_GET['url']))
print_r(apache_ lookup_uri($_GE T['url']));
?>
</pre>

Gave the right looking results for various aliases on my system.

--
Andy Hassall (an**@andyh.co. uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
2538
by: Kim Jensen | last post by:
I'd like to make a directory listing where instead of the entire filename I need it to show the filename minus the extention and get the value of charname= in the file itself. I've been told that I had to turn the directory listing into an array and then use "foreach (array as item)" to go through and open each file but I've tried several different approaches and I just can't get it to work. I've been able to make it list the directory...
19
3321
by: SU News Server | last post by:
I've struggled with this for quite a while and I'm am just not sure what is going on. I have the following code import os def buildList( directory='/Users/mkonrad' ) dirs = listing = os.listdir(directory)
2
3379
by: Tom | last post by:
I need to get a directory listing through http. If I put the directory path in the browser address bar such as http://somewebpage.com/subdir I get the listing of the directory. Of course this is returned to my client in html. To get the directory listing from this I would need to do some intersting parsing. ftp is not enabled and so I can't do an "ls" through some ftp client. Is there some way in C# to get a directory listing using...
8
11071
by: gil | last post by:
Is it possible to prevent a browser from listing the entire contents of a folder? The site, is hosted on my ISP with the following layout- site/ "user name from ISP" pagefile (dir) index.html site/pagefile/
2
1716
by: ngr | last post by:
I used to use the DirListox control in VB6 but this is no longer supported in VB.NET. What I want to do: I want to take a directory listing and show any subdirectories in a list. When you click on a directory in the list another list appears with the directory listing of files and directories within it. Can anyone please advise how to take a list of directories within a directory and then independantly of that another routine to take...
8
6959
by: dougawells | last post by:
Hi - I'm hoping for help with the auto-generation of a hyperlinked listing of all files in a directory. The server I use does not auto-generate this. So, when someone comes to this directory and thus opens index.htm, I want that file to show a listing of all files in the directory with hyperlinks to them. Thanks for the help, Doug
7
5504
by: epikto | last post by:
I have a mapped share that I am trying to get a listing of all the files that it contains. I use the following code to access the contents String files = Directory.GetFiles(path); I can then enumerate through that array to get my listing. However I am trying to set my application up as a service. And now (after calling methods in a thread using the OnStart() method) it says the directory does not exist (I verified this with a...
4
3254
by: techusky | last post by:
I have a *very* simple script written that displays the directory listing of the current working directory, but I am having some difficulty when I try to change folders. Basically, I have my $dir variable set to this: --- $dir = getcwd() . "\\" . $nav; --- but for some reason the script does not actually display the contents of the directory if you change from the directory the script is located in. Here is my code if someone is willing...
5
3492
by: jain236 | last post by:
HI every body, i am always getting the following error while parsing a directory . i am reading a directory by doing ls and trying to find out the name,type,size, mtime and mode of files from the directory my @valeu =@{$Files}; foreach my $file (parse_dir(\@valeu)) { @Files = $ftp->ls('-lR');
0
9934
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11137
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10736
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
10409
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9570
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
7969
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
7120
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
5795
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...
0
5989
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.