Código PHP:
$path = $_GET['path'];
if(!isset($path))
{
$path = "documentos";
}
if ($handle = opendir($path))
{
$curDir = substr($path, (strrpos(dirname($path."/."),"/")+1));
print "Directorio Actual: ".dirname($path."/.")."<br>************************<br>";
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != "..")
{
$fName = $file;
$file = $path.'/'.$file;
if(is_file($file))
{
print " <a href='".$file."'>".$fName."</a> ".filesize($file)." bytes<br>";
}
}
}
closedir($handle);
}