note 106117 added to features.file-upload
| From: | seyhun_cavus at hotmail dot com | Date: | Tue, 11 Oct 2011 18:59:11 +0000 |
| Subject: | note 106117 added to features.file-upload | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-183818@lists.php.net to get a copy of this message | ||
I apologize, I wrote wrong in my previous message. Here is Correct:
https://bugs.php.net/bug.php?id=26004
define('UPM_GS_MAXSIZE','1024'); //max file size of user (in KB)
//Check for minimum size and compare
$maxsize = (int)UPM_GS_MAXSIZE * 1024;
$sizeerr = false;
$postmax = ini_get('post_max_size');
$pmul = substr($postmax, -1);
$pmul = ($pmul == 'M' ? 1048576 : ($pmul == 'K' ? 1024 : $sizeerr = true));
$pmul = $pmul*(int)$postmax;
$uploadmax = ini_get('upload_max_filesize');
$umul = substr($uploadmax, -1);
$umul = ($umul == 'M' ? 1048576 : ($umul == 'K' ? 1024 : $sizeerr = true));
$umul = $umul*(int)$uploadmax;
$memmax = ini_get('memory_limit');
$mmul = substr($memmax, -1);
$mmul = ($mmul == 'M' ? 1048576 : ($mmul == 'K' ? 1024 : $sizeerr = true));
$mmul = $mmul*(int)$memmax;
$minmul = min($mmul, $umul, $pmul);
if ($minmul > $maxsize) $minmul = $maxsize;
define('ERROR_1_BIG_IMAGE','Error1:File size must be lower then ' . $minmul .
' KB.');
define('ERROR_2_BIG_IMAGE','Error2: File size must be lower then ' . $minmul .
' KB.');
define('ERROR_3_BIG_IMAGE','Error3: File size must be lower then ' . $minmul .
' KB.');
if ($sizeerr === true) {
//error
} elseif ($_SERVER['CONTENT_LENGTH'] > $minmul) {
//error
}
----
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/106117
Del: integrated -- https://master.php.net/note/delete/106117/integrated
Del: useless -- https://master.php.net/note/delete/106117/useless
Del: bad code -- https://master.php.net/note/delete/106117/bad+code
Del: spam -- https://master.php.net/note/delete/106117/spam
Del: non-english -- https://master.php.net/note/delete/106117/non-english
Del: in docs -- https://master.php.net/note/delete/106117/in+docs
Del: other reasons-- https://master.php.net/note/delete/106117
Reject -- https://master.php.net/note/reject/106117
Search -- https://master.php.net/manage/user-notes.php