Re: remote directorylisting
| From: | lallous | Date: | Wed, 05 Dec 2001 11:39:41 +0000 |
| Subject: | Re: remote directorylisting | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-76703@lists.php.net to get a copy of this message | ||
Well, This is not really possible, unless the server itself allows you to do
the listing.
One way and after the last condition you can use
fopen("sever.com/dir_to_list/") then fread() it and then parse the content
in order to get filename, date, ...
"Håkon grønning" <Hakon.Gronning@iet.hist.no> wrote in message
news:3C0DEB31.96BDA532@iet.hist.no...
> Does anybody know how to list a remote directory to get
> all the filenames into for example an array?
>
> This is easily done on your local server by:
> $handle=opendir('./images/');
> while (($file = readdir($handle))!==false) {
> $filelist[] = $file;
> }
> closedir($handle);
>
> However, opendir and readdir does not work on remote
> servers:
> $handle=opendir('http://www.somesite.net/images/');
>
> So, does anybody know how to do this.
> I know I can read remote files (directory listing) and then
> To analyse this for filenames with a lot of string manipulation
> operations. Is there a simpler approach?
>
>
> Håkon Grønning
> E-mail: hakon.gronning@iet.hist.no