Upload Limit Size There are 3 kind of limits:
- Limit Specified in HTML code
- Limit specified by you-PHP program
- Limit specified of upload_max_filesize in PHP Configuration Directives.
But in some cases, the value you specified exceeds the value upload_max_filesize.
The question is how to check this value?
You can use the following functions:
function return_bytes($val)
{
$val = trim($val);
$last = strtolower($val{strlen($val)-1});
switch($last)
{
case 'g':
$val *= 1024;
case 'm':
$val *= 1024;
case 'k':
$val *= 1024;
}
return $val;
}
function upload_max_filesize()
{
return return_bytes(ini_get(\'upload_max_filesize\'));
}
No comments:
Post a Comment