note 106116 deleted from features.file-upload by danbrown
| From: | danbrown@php.net | Date: | Tue, 11 Oct 2011 18:38:06 +0000 |
| Subject: | note 106116 deleted from features.file-upload by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-183817@lists.php.net to get a copy of this message | ||
Note Submitter: seyhun_cavus at hotmail dot com
----
https://bugs.php.net/bug.php?id=26004
//Check for minimum size and compare
$sizeerr = false;
$postmax = ini_get('post_max_size');
$pmul = substr($postmax, -1);
$pmul = ($pmul == 'M' ? 1048576 : ($pmul == 'K' ? 1024 : $sizeerr = true));
$uploadmax = ini_get('upload_max_filesize');
$umul = substr($uploadmax, -1);
$umul = ($umul == 'M' ? 1048576 : ($umul == 'K' ? 1024 : $sizeerr = true));
$memmax = ini_get('memory_limit');
$mmul = substr($memmax, -1);
$mmul = ($mmul == 'M' ? 1048576 : ($mmul == 'K' ? 1024 : $sizeerr = true));
$minmul = min($postmax, $uploadmax, $memmax);
if ($sizeerr === true) {
//error
} elseif ($_SERVER['CONTENT_LENGTH'] > $minmul) {
//error
}
Regards.
Seyhun Cavus.