note 106116 added to features.file-upload
| From: | seyhun_cavus at hotmail dot com | Date: | Tue, 11 Oct 2011 18:35:53 +0000 |
| Subject: | note 106116 added to features.file-upload | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-183816@lists.php.net to get a copy of this message | ||
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.
----
Server IP: 69.147.83.197
Probable Submitter: 31.41.16.77
----
Manual Page -- http://www.php.net/manual/en/features.file-upload.php
Edit -- https://master.php.net/note/edit/106116
Del: integrated -- https://master.php.net/note/delete/106116/integrated
Del: useless -- https://master.php.net/note/delete/106116/useless
Del: bad code -- https://master.php.net/note/delete/106116/bad+code
Del: spam -- https://master.php.net/note/delete/106116/spam
Del: non-english -- https://master.php.net/note/delete/106116/non-english
Del: in docs -- https://master.php.net/note/delete/106116/in+docs
Del: other reasons-- https://master.php.net/note/delete/106116
Reject -- https://master.php.net/note/reject/106116
Search -- https://master.php.net/manage/user-notes.php