ive got this script and $totalsize is showing 8192 (bytes)
when the folder is emty
$path = "../images/";
$dir=opendir($path);
$totalsize = '';
while ($file = readdir ($dir))
{
$size = filesize("../images/$file");
$totalsize += $size;
if ($file != "." && $file != ".." && eregi(".gif",$file) || eregi(".jpg",$file) )//checks the format (must be .gif or .jpg)
{
echo "<tr><td width=\"42%\"><a href=\"../images/$file\">$file</a></td>
<td width=\"16%\">$size</td>
<td width=\"48%\"><a href=\"$PHP_SELF?filename=$file\">Delete</a></td></tr>";
}
}
closedir($dir);