How Much Web Space left?

Web hosting, FTP/database access, mirror services and hosted blogs
Post Reply
Posts: 46
Joined: Mon Mar 06, 2006 7:21 pm

How Much Web Space left?

Post by leithant » Tue May 11, 2010 11:52 am

How do I check the above, please?


Volunteer Site Admin
Posts: 6003
Joined: Mon Nov 13, 2006 1:16 pm
Location: Sydney

Re: How Much Web Space left?

Post by Dazzled » Tue May 11, 2010 12:03 pm

There are a few tricks- one way if you only have Windows is to put this in your site, call it sitesize.php, and navigate to it (it works on all systems) and get a count in bytes:

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<title>webspace size</title>

<body background="#FFF">
// function du written by Gregor Mosheh on 17-Jul-2003 03:25
// version 1.01 written by psylogic
// just run this script and it will return the current size of your webspace in bytes

function du($location) {
if (!$location or !is_dir($location)) {
return 0;

$total = 0;

$all = opendir($location);
while ($file = readdir($all)) {
  if (is_dir($location.'/'.$file) and $file <> ".." and $file <> ".") {
  $total += du($location.'/'.$file);
elseif (!is_dir($location.'/'.$file)) {
  $stats = stat($location.'/'.$file);
  $total += $stats['size'];
return $total;

<div style="background-color:#ccc;">
print du(getcwd());
<br />
<br />
print getcwd();
<br />

If you use Linux, just mount your site folder and use the normal file facilities. On Ubuntu it's Places->Connect to Server, or even easier: Baobab (Disk usage analyser) and press the remote folder icon, like this (for a site with 2 folders and 93 MB used) -
Screenshot-19.png (31.04 KiB) Viewed 1174 times

Post Reply