Sunday, 8 September 2013

Using filesize() to get the total file size of a directory and it's contents

Using filesize() to get the total file size of a directory and it's contents

I'm using filesize() to hopefully return the total file size of an image
directory. The code returns a size of 24mb which I know is incorrect, the
directory has around 200+mb of images. Any ideas?
<?
$filename = '../uploads';
echo (filesize($filename) / 1024) . ' mb';
?>

No comments:

Post a Comment