Forum Moderators: phranque

Message Too Old, No Replies

How to let other websites list files in a directory?

I know a Javascript way but concerned about security.

         

HughMungus

11:21 pm on Jun 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



So I have a website and there are a bunch of files in a directory that I want other people running websites to be able to show as a list and access. I know I can have my system create a list of files and then use a Javascript include to let other websites use that list of files/links on their site.

The problem is that if I have a list of files in the directory then anyone can access the list of files...and I really don't want to use HTACCESS to limit access...

What are the other ways to do this? What about allowing other sites to get a list of files dynamically (that is, some code on their page that gets a list of files in their directory on my site)? A cross-platform solution (iis/nix) would be great.

Ideas?

TIA!

hakre

10:13 am on Jun 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hi HughMungus, welcome to webmasterworld [webmasterworld.com].

the only thing as a plattform-independent script running on your webserver should be a php [php.net]-script. php is supported on many plattforms and webservers. it has a filesystem lib build in which will let you code that kind of a directory script in minutes with example code in the php documentation. checkout if you can use php on your webserver.

the other solution is apache based, so any plattform with the apache webserver on it can utilize this. just allow indexes in the specific diretory and you'll get a listing on the fly by accessing the uri of that directory. the directive is:

options +indexes

hope this will help you,
hakre

oilman

4:12 pm on Jun 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This may be oversimplified for what you want but you could just create the list on a page on your server and let others just frame it up.

HughMungus

10:58 pm on Jun 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This may be oversimplified for what you want but you could just create the list on a page on your server and let others just frame it up.

Well, what I'm trying to do is make it available to the website operators but not to the general public...I guess no matter how I do it I'll need some security in there, otherwise third-parties could run the same PHP or whatever to get a list of files...

Anyone know how to do a remote directory listing with a password or other type of authentication?

Oh, and, thanks Hakre.