I've recently added this to my site to show all the files in the uploads directory.
Code:
<?php
$dir = "http://mysite.com/files/uploads/"; // Name of the directory you want to view using the script
// Open a known directory, and proceed to read its contents
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
echo "filename: $file : filetype: " . filetype($dir . $file) . "/n";
}
closedir($dh);
}
}
if ($handle = opendir('.')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
echo "$file<br />";
}
}
closedir($handle);
}
?>
For me I just have that code in the index.php page in the uploads directory