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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.