Jump to content

List files script


tr1x

Recommended Posts

I've looked for hours but I can't find the script that I need, and I'm not good enough at PHP to write it myself, so I was wondering if someone could share some code with me.

 

All I need is a script that will list all the files in a directory, and display the filesize next to the filename. Also.. since I have over 1,000 files in the directory, is it possible to make it display like 100 per page or something?

 

Any help is greatly appreciated.

Link to comment
https://forums.phpfreaks.com/topic/110355-list-files-script/
Share on other sites

you can use scandir().

 

this will retrieve the files in a directory and stores it into an array (just filenames though but it should be enough).

 

for paging, yes. you just need to monitor the index of the array where you stored the result from scandir().

 

cheers,

 

Jay

Link to comment
https://forums.phpfreaks.com/topic/110355-list-files-script/#findComment-566213
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.