files that user can download

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
User avatar
orangeapple
Forum Commoner
Posts: 70
Joined: Tue Jan 06, 2004 1:24 pm
Location: Geneva / Switzerland

files that user can download

Post by orangeapple »

Hi !

I would like to have xls files on a directory, on the server that user can download if they want. How can I make the links for downloading appear on a php page ?

Basically, php should search for the different xls files in a directory and echo their link for download on the page, is that possible ?
Thanks for your help !
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

Moved To Code
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

to get a directory listing, use either opendir() or glob().

then just loop over the results and echo out an anchor tag with a link to your file...
Post Reply