Why do I get an empty array instead of an error message when the upload files are exceeding the upload_max_filesize?
How can I get the error code number 1 like this below?
1 => 'The uploaded file exceeds the upload_max_filesize directive in php.ini',
I have set my upload max limit to 2MB in .htaccess:
php_value post_max_size 2M
php_value upload_max_filesize 2M
My HTML form:
<form class="form-submission" method="post" action="upload.php" enctype= "multipart/form-data">
<input type="file" name="upload[]" id="input-file" multiple required>
<button type="submit" class="btn btn-default no-gradient">Submit</button>
</form>
upload.php:
print_r($_FILES);
Then I try to upload files larger then 2MB. The result is:
Array ( )
No error coming from PHP. How can I make sure that PHP returns an error? Is it possible?
If I have this in my upload.php:
print_r($_SERVER['CONTENT_LENGTH']);
I get this:
6564878 // what is this mean??