bapi Posted April 11, 2007 Share Posted April 11, 2007 How can i find out the file size of a folder present in site root folder. for example : /-- | [ram] #folder Now i want to know the file size of this folder call (ram) in site root folder. Actu. I want to display the folder size in my page. Link to comment https://forums.phpfreaks.com/topic/46546-how-can-i-find-out-file-size/ Share on other sites More sharing options...
AndyB Posted April 11, 2007 Share Posted April 11, 2007 http://ca.php.net/manual/en/function.readdir.php http://ca.php.net/manual/en/function.filesize.php Link to comment https://forums.phpfreaks.com/topic/46546-how-can-i-find-out-file-size/#findComment-226589 Share on other sites More sharing options...
tenfold Posted April 11, 2007 Share Posted April 11, 2007 gonna have to do a loop, add up all the sizes of all the files in the folder Link to comment https://forums.phpfreaks.com/topic/46546-how-can-i-find-out-file-size/#findComment-226590 Share on other sites More sharing options...
s0c0 Posted April 11, 2007 Share Posted April 11, 2007 Or you could half ass it with something like this (if your on a nix system): $sizematters = exec('du -h /the/directory/'); echo $sizematters; You can use str_replace() to remove all the crap out of that output you don't need. I'm going to guess thats not a best practice solution though lol. Link to comment https://forums.phpfreaks.com/topic/46546-how-can-i-find-out-file-size/#findComment-226622 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.