Jump to content

Increasing the MAX filesize


craigtolputt

Recommended Posts

Hi Peeps,

 

I am trying to increase the MAX FILESIZE allowed to upload through a PHP CMS system that i have integrated into my site.

 

I have found this bit of code which i think should change it but havnt got a clue what it means...

 

//
//	nc_return_size_string()
//
//	Pass a byte value to convert to string equivalent rounded  (Example: 2097152 == '2098 KB')
//
function nc_return_size_string($val) 
{
if($val > 1048576)
	 return round(($val/1048576), 2).' MB';
if($val > 1024)
	 return round((integer)($val/1024), 2).' KB';

    return ($val).' Bytes';
}
//
//	nc_return_bytes()
//
//	Pass ini_get("upload_max_filesize") string to get the value in bytes. (Example: '2M' == 2097152)
//
function nc_return_bytes($val) 
{
    $val = trim($val);
    $last = strtolower(substr($val, -1));

if($last == 'g')
	$val = $val*1024*1024*1024;
if($last == 'm')
	$val = $val*1024*1024;
if($last == 'k')
	$val = $val*1024;

    return $val;
}

 

How would i make the max file size change from 2M to say 6M???

 

 

I have also uplaoded a php.ini file containing this

 

upload_max_filesize = 6M
post_max_size = 12M
memory_limit = 24M

 

and a HTACCESS File containing this

 

php_value upload_max_filesize 6M
php_value post_max_size 12M

 

Please if anyone knows i would be very greatfull.

 

 

thanks

 

Craig

Link to comment
https://forums.phpfreaks.com/topic/197984-increasing-the-max-filesize/
Share on other sites

Your PHP.ini settings are correct, but unfortunately the code you have posted relates to parsing a file size in bytes as megabytes/gigabytes.

 

Are you sure there isn't documentation for your CMS on doing this? There must be, I bet you there is or it wouldn't be a good CMS in the first place.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.