Changed error checking sequence so that an oversize file (because of PHP
ini settings or because of CFileValidator parameters) will always add an
error message to the attribute, but if there was an error uploading the
file then the method will return after adding the error.
After checking file size, we then check that there is no error uploading
the file (which avoids the previous version of evaluating every possible
error code before continuing potentially reducing the number of
evaluations by 4 for a normally uploaded file).
Added a final else in the error code section so that if there is an
unrecognised error code we still throw an exception rather than
continuing as if everything was ok.
Left the check on $file->tempName not being empty when checking MIME
types because that does have the potential to cause an exception.