To get a dirsize recursive you can use this simple function:
<?php # copyright by fackelkind | codeMaster
function getRecDirSize ($connection, $dir){
$temp = ftp_rawlist ($connection, "-alR $dir");
foreach ($temp as $file){
if (ereg ("([-d][rwxst-]+).* ([0-9]) ([a-zA-Z0-9]+).* ([a-zA-Z0-9]+).* ([0-9]*) ([a-zA-Z]+[0-9: ]*[0-9]) ([0-9]{2}:[0-9]{2}) (.+)", $file, $regs)){
$isdir = (substr ($regs[1],0,1) == "d");
if (!$isdir)
$size += $regs[5];
}
}
return $size;
}
$dirSize = getRecDirSize ($conID, "/");
?>