Set error file exceeds the upload_max_filesize

How can I set an error in my model (before validation) if $objFile->getError() returns '1' (which means "file exceeds the upload_max_filesize"), which I can show with the CHtml::errorSummary() function?

Seems like this can't be done by validate(), because I don't come to the point of validation. This is what "CUploadFie::getInstance()" returns:

CUploadedFile#1

(

    [CUploadedFile:_name] => 'bigfile.png'

    [CUploadedFile:_tempName] => ''

    [CUploadedFile:_type] => ''

    [CUploadedFile:_size] => 0

    [CUploadedFile:_error] => 1

    [CComponent:_e] => null

    [CComponent:_m] => null

)

The 'file' validator already handles this. If the file is too big, it will show its 'tooLarge' message. Please check the API manual for CFileValidator for more details.

Quote

The 'file' validator already handles this. If the file is too big, it will show its 'tooLarge' message. Please check the API manual for CFileValidator for more details.

I don't get to the point where I can validate, because of the following code:

$objFile  = CUploadedFile::getInstance($objImage, "strImage[$n]");

if (is_object($objFile) && $objFile->getSize() > 0)

{

  $this->arrImageUpload[$n]->strImage = $objFile;

  $booValid = $booValid && $this->arrImageUpload[$n]->validate();

}

At this point $objFile->getSize() returns "0".

EDIT:

I've modified the code, and now it works. Thanks a lot Qiang!