craigtolputt Posted April 8, 2010 Share Posted April 8, 2010 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 More sharing options...
oni-kun Posted April 8, 2010 Share Posted April 8, 2010 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 https://forums.phpfreaks.com/topic/197984-increasing-the-max-filesize/#findComment-1038913 Share on other sites More sharing options...
craigtolputt Posted April 8, 2010 Author Share Posted April 8, 2010 I have used the nc-cms script from here http://bit.ly/aB4tGd but cannot find anywhere that tells me how to change the max size Link to comment https://forums.phpfreaks.com/topic/197984-increasing-the-max-filesize/#findComment-1038949 Share on other sites More sharing options...
craigtolputt Posted April 8, 2010 Author Share Posted April 8, 2010 Sorted, i have enabled PHP5 on the server and then changed the name of the php.ini file to php5.ini and its worked. Link to comment https://forums.phpfreaks.com/topic/197984-increasing-the-max-filesize/#findComment-1038952 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.