<!DOCTYPE html>
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><font size="4">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</font></p>
    <p><font size="4">public static function getMaxUploadSize() {...}</font></p>
    <p><font size="4">public static function getMaxUploadSizeInBytes()
        {}</font></p>
    <p><font size="4"><br>
      </font></p>
    <p><font size="4">A value of 5MB limit is hardcoded in the following
        files:</font></p>
    <p><font size="4">layouts/v7/modules/Settings/Vtiger/ConfigEditorDetail.tpl</font></p>
    <p><font size="4">Line 28 {if $FIELD_NAME == 'upload_maxsize'}{if
        $FIELD_DATA[$FIELD_NAME] gt 5}{....</font></p>
    <p><font size="4">layouts/v7/modules/Settings/Vtiger/ConfigEditorEdit.tpl</font></p>
    <p><font size="4">Line 16 'upload_maxsize'    =>
        'data-rule-range=[1,5] ... <br>
      </font></p>
    <p><font size="4">Line 31 {if $FIELD_NAME == 'upload_maxsize'}{if
        $FIELD_DATA[$FIELD_NAME] gt 5} ...</font></p>
    <p><font size="4">modules/Settings/Vtiger/models/ConfigModule.php<br>
      </font></p>
    <p><font size="4">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) ....</font></p>
    <p><font size="4"><br>
      </font></p>
    <p><font size="4">Anywhere else in the code is used something like:</font></p>
    <p><font size="4">$viewer->assign('MAX_UPLOAD_LIMIT_MB',
        Vtiger_Util_<a class="moz-txt-link-freetext" href="Helper::getMaxUploadSize())">Helper::getMaxUploadSize())</a>;<br>
        $viewer->assign('MAX_UPLOAD_LIMIT_BYTES',
        Vtiger_Util_<a class="moz-txt-link-freetext" href="Helper::getMaxUploadSizeInBytes())">Helper::getMaxUploadSizeInBytes())</a>;<br>
      </font></p>
    <p><font size="4">OR</font></p>
    <p><font size="4">$viewer->assign('MAX_UPLOAD_LIMIT',
        vglobal('upload_maxsize'));</font></p>
    <p><font size="4"><br>
      </font></p>
    <p><font size="4">Isn't complex to fix this in order to make
        upload_maxsize freely configurable via user interface. We are
        working on it.<br>
      </font></p>
    <p><font size="4"><br>
      </font></p>
    <p><font size="4">Have you have experienced this problem? Do you
        already have a solution o suggest a workaround?<br>
      </font></p>
    <pre class="moz-signature" cols="72">-- 
Vincenzo Bruno
Coopyleft - <a class="moz-txt-link-abbreviated" href="http://www.coopyleft.it">www.coopyleft.it</a>
Hacklab Cosenza (<a class="moz-txt-link-abbreviated" href="http://www.hlcs.it">www.hlcs.it</a>)
    
</pre>
  </body>
</html>