|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-07-27 15:43 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 30 06:00:01 2025 UTC |
Description: ------------ HTML_Quickform uses a default maximum upload filesize of 1megabyte, which is set through the private property _maxFileSize. IMO, it would be better to follow the filesize specified by php.ini, as this is the value that finally decides what size an upload can be. Reproduce code: --------------- Place this in the constructor: if (preg_match('/^([0-9]+)([a-zA-Z]*)$/', ini_get('upload_max_filesize'), $matches)) { // according to: // http://www.php.net/manual/en/faq.using.php#faq.using.shorthandbytes // valid values are G, M or K, or no multiplier at all. switch (strtoupper($matches['2'])) { case 'G': $this->_maxFileSize = $matches['1'] * 1073741824; break; case 'M': $this->_maxFileSize = $matches['1'] * 1048576; break; case 'K': $this->_maxFileSize = $matches['1'] * 1024; break; default: $this->_maxFileSize = $matches['1']; } }