Set your max_upload_size in your php.ini file to something like 100 MB and then use the $youruploadfilevariablename_size to test against like:
$max_size = "2000000";
if ($youruploadfilevariablename_size > $max_size) {
report some error;
}
There is no way to stop it before it gets to the tmp location on the server and it won't get there if its bigger than the size inthe ini file. And you get test the size until its at tmp location. Had the same prob yesterday