+ [directory.php] Required parameter 'dir' missing. Exiting."); } $sPathname = $_SERVER['DOCUMENT_ROOT'].$aParams['dir']; if (file_exists($sPathname)) { $aDirectory = dir($sPathname); while ($entry = $aDirectory->read()) { if ($entry!="." || $entry!="..") { if (!str_contains($entry, ".")) { $sBase = $entry; } else { $sBase = substr($entry, 0, strrpos($entry, ".")); } $aResults[] = array ( "name" => $entry, "base" => $sBase, "ext" => strrchr($entry, '.'), "size" => formalsize(filesize($sPathname."/".$entry)), "type" => filetype($sPathname."/".$entry)); } } return $aResults; } return ""; } function FormalSize($sSize) { if ($sSize <= 1024) { return $sSize."b"; } elseif ($sSize <= 1048576) { return round($sSize/1024,1)."kb"; } else { return round($sSize/1048576,1)."mb"; } } ?>