The problem is that I want to check if the file is too large to upload so that I can display a relevant error message, but when the file is larger than upload_max_filesize in php.ini it seems to be only displaying a 0.
Why is this happening? How can I test that the file is too large to give a relevant error?
See http://php.net/manual/en/features.file-upload.errors.php
Relevant excerpt:
Since PHP 4.2.0, PHP returns an appropriate error code along with the file array. The error code can be found in the error segment of the file array that is created during the file upload by PHP. In other words, the error might be found in $_FILES['userfile']['error'].
UPLOAD_ERR_OK Value: 0; There is no error, the file uploaded with success.
UPLOAD_ERR_INI_SIZE Value: 1; The uploaded file exceeds the upload_max_filesize directive in php.ini.