If you're controlling uploads, you can use php to recursively check the sizes of the files in the directory. That will work if it's a low traffic site with only a few files.
If it's a higher traffic site (and even if it's not), you might be better to have a hidden file that contains the total size of all the files. Then just update that file when something is uploaded or deleted.
Some operating systems (FreeBSD, some versions of Linux, and WinNT/XP) support filesystem quotas, but they require administrative priveliges that few have.