if ($_FILES["fieldname"]["size"] > ini_get("post_max_size")) {
echo("Sorry, but the max upload size is limited to".float(ini_get("post_max_size")/1024)." Kb.");
}
else {
// do upload stuff
}
This also does a small conversion: post_max_size is converted to kilobytes. 1024 bytes = 1 kilobyte, 1024 kilobytes = 1 meg, etc.
Hope this helps.