[Vtigercrm-developers] upload_maxsize Hardcoded

Vincenzo Bruno v.bruno at vinsoft.it
Tue Mar 11 10:42:56 GMT 2025


Trying to increase the upload_maxsize value we discovered it is 
hardcoded in few key points, despite there is a configurable value in 
config.inc.php and proper functions in modules/Vtiger/helpers/Util.php

public static function getMaxUploadSize() {...}

public static function getMaxUploadSizeInBytes() {}


A value of 5MB limit is hardcoded in the following files:

layouts/v7/modules/Settings/Vtiger/ConfigEditorDetail.tpl

Line 28 {if $FIELD_NAME == 'upload_maxsize'}{if $FIELD_DATA[$FIELD_NAME] 
gt 5}{....

layouts/v7/modules/Settings/Vtiger/ConfigEditorEdit.tpl

Line 16 'upload_maxsize'    => 'data-rule-range=[1,5] ...

Line 31 {if $FIELD_NAME == 'upload_maxsize'}{if $FIELD_DATA[$FIELD_NAME] 
gt 5} ...

modules/Settings/Vtiger/models/ConfigModule.php

Line 157 } else if((array_key_exists('upload_maxsize',$updatedFields) 
&&  filter_var(ltrim($updatedFields['upload_maxsize'], '0'), 
FILTER_VALIDATE_INT, array("options" => array("min_range"=>1, 
"max_range"=>5))) === false) ....


Anywhere else in the code is used something like:

$viewer->assign('MAX_UPLOAD_LIMIT_MB', 
Vtiger_Util_Helper::getMaxUploadSize());
$viewer->assign('MAX_UPLOAD_LIMIT_BYTES', 
Vtiger_Util_Helper::getMaxUploadSizeInBytes());

OR

$viewer->assign('MAX_UPLOAD_LIMIT', vglobal('upload_maxsize'));


Isn't complex to fix this in order to make upload_maxsize freely 
configurable via user interface. We are working on it.


Have you have experienced this problem? Do you already have a solution o 
suggest a workaround?

-- 
Vincenzo Bruno
Coopyleft -www.coopyleft.it
Hacklab Cosenza (www.hlcs.it)
     
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20250311/faf20987/attachment.html>


More information about the vtigercrm-developers mailing list