PHP Classes

File Display: Displays listings of files and directories

Recommend this page to a friend!
  Info   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 57%Total: 4,046 All time: 769 This week: 299Up
Version License Categories
filedisplay 1.0GNU Lesser Genera...HTML, Files and Folders
Description Author

This class is meant to output listings of files and sub-directories of a given directory using HTML tables.

It can be configured to display or not display several types of information such as: file size, file/folder permissions, last modified date, etc..

It may restrict the listing of files based on the file name extension. Currently, the default is to allow showing only image files: GIF, JPEG and PNG.

It may also show different icons with files depending on their file name extension.


Find Large Files
I need to find large files on a server

Picture of Gregory Lane
Name: Gregory Lane <contact>
Classes: 1 package by
Country: New Zealand New Zealand
Age: 49
All time rank: 7615 in New Zealand New Zealand
Week rank: 592 Up3 in New Zealand New Zealand Up

Documentation for FileDisplay class

Created by Greg Lane, Nov 3rd, 2003


Lesser GPL.  (See for more details.)


The FileDisplay class will show a directory listing of folders and files
in a specified root directory.  (actually only images and folders - if you
alter the checkext method, you can display all or a limited selection of
The class adds links to each subdirectory.  When you click on a subdirectory,
the page reloads and the contents of the subfolder (including any subdirectories)
is displayed.  You can display an endless number of subdirectories, but the
filepath from the root directory is displayed at the top of the page, so the
formatting might get a little messy if you explore too deep!


Upload the file and the images to your web server.
You will need to create at least two icon images (1 for files & the other
for directories) and put them in the same directory as
Apache has some good images in the 'icons' directory.


See accompanying file - test_FileDisplay.php
For explanations of each of the methods of the class, see the comments in


The target folder information is contained in the query string.  So that users
don't enter ../../ in the querystring and explore your entire file system, the
code checks that the root directory (a directory of your choosing) is a sub 
string of the target dir. 

Last Comments:

This is the first class I've submitted.  I know it doesn't do anything
revolutionary, but it's simple, self-contained and meets the needs for which
I designed it.
If you have any fixes, suggestions, rewrites, additions, please let me know.
  Files folder image Files  
File Role Description
Plain text file Class Contains the FileDisplay class.
Plain text file manual.txt Doc. User instructions and change log
Accessible without login Plain text file readme.txt Doc. Readme
Plain text file test_FileDisplay.php Example Demo

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:769
This week:299Up
 User Ratings  
 All time
For more information send a message to info at phpclasses dot org.