NC wrote :
Harold Crump wrote:
I need to get a list of all files in a particular virtual
directory on a web site, such as -
http://www.myServer.com/FileStore
I tried using the directory functions, but this doesn't work.
Directory functions only work on local file systems, not
over HTTP. This is clearly spelled out in the PHP Manual.
Is there a way to do this?
Yes, but only under two conditions (both are required):
1. There is no directory index in the target directory, and
2. The HTTP server on the remote system is allowed to
provide the directory listing in response to a request
for the directory name.
In Apache, the name of the directory index is set by the
DirectoryIndex directive. To allow listing the contents
of the directory, you should specify the Options Indexes
directive.
Cheers,
NC
Even with these two conditions met, how would the php script know what
the files are? Wouldnt the return result just be an HTML page with <a>
tags that may or may not be links to files?
The web server software "apache", "IIS", etc would each spit out the
directory listing differently. However, all in HTML.
I would have thought the only way to do this would be to an FTP server.
--
if the oil light is on, dont think it will just go away