note 100728 deleted from features.file-upload by googleguy
| From: | googleguy@php.net | Date: | Wed, 22 Aug 2012 01:47:12 +0000 |
| Subject: | note 100728 deleted from features.file-upload by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-190166@lists.php.net to get a copy of this message | ||
Note Submitter: ling
----
Sometimes you may get empty $_FILES and empty $_POST.
If this happens, this is probably because the posted file size exceed the post_max_size php ini
directive value.
You could use something like this to handle it in your form, here it is :
<?php
// The form isn't misbehavin thenâ¦
if (empty($_FILES) && empty($_POST) && isset($_SERVER['REQUEST_METHOD'])
&& strtolower($_SERVER['REQUEST_METHOD']) == 'post') {
$poidsMax = ini_get('post_max_size');
$oElement->addError("fileoverload", "Your feet is too big, maximum allowed
size here is $poidsMax.");
}
?>