MAX_FILE_SIZE没有给出错误?

I set a limit with a max of 10MB to uploads in my php code with

define ('MAX_FILE_SIZE', 1048576 * 10);
if ($_FILES['uploadphoto']['size'] > MAX_FILE_SIZE) { $errors[] = "Photo exceeds 10MB limit.";}

Which works fine. But I know you can put this;

<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo MAX_FILE_SIZE; ?>" />

In the form so that the user knows he uploaded a file too large instantly. This works but it doesn't give the user an error message that the file was too large. What can I do to show an error message?

Forgot about case 2!

switch($_FILES['uploadphoto']['error']) {

case 2:
echo 'Photo exceeds 10MB limit.';
break;
}

Thank you @Passerby!