script to display list of files in a directory?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
waskelton4
Forum Contributor
Posts: 132
Joined: Mon Sep 09, 2002 6:42 pm

script to display list of files in a directory?

Post by waskelton4 »

Hello Everyone,

I've been searching for a way to dynamically display a list of files contained in a directory but i'm not really sure what i should be searching for.

What i have is a form that users use to upload files to the webserver and I need to provide a way for certian people to view these files without worrying with ftp. Anybody out there know of a file or script that can be dropped in that directory that will, when accessed, read the current list of files and display them for downloading or viewing?

If there isn't such a thing, where would I begin if i wanted to write this?

Any help is greately appreciated.

Thanks
Will
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Probably best to start here:
http://www.php.net/manual/en/ref.dir.php

Mac
waskelton4
Forum Contributor
Posts: 132
Joined: Mon Sep 09, 2002 6:42 pm

Post by waskelton4 »

Perfect..

Thanks Mac
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post by Gen-ik »

As far as I know you can only read 'local' directories.. so trying to read the directory of someone elses website won't work.
Post Reply