note 100728 modified in features.file-upload by danbrown
| From: | danbrown@php.net | Date: | Wed, 03 Nov 2010 13:26:45 +0000 |
| Subject: | note 100728 modified in features.file-upload by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-173708@lists.php.net to get a copy of this message | ||
As said before on this page,
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.");
}
?>
--was--
As said before on this page,
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 :
// 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.");
}
http://php.net/manual/en/features.file-upload.php