source/Application/Controller/Admin/AdminController.php
protected function _getMaxUploadFileInfo($iMaxFileSize, $blFormatted = false)
    {
        $iMaxFileSize = $iMaxFileSize ? $iMaxFileSize : '2M';

        // processing config
        $iMaxFileSize = trim($iMaxFileSize);
        $sParam = strtolower($iMaxFileSize{strlen($iMaxFileSize) - 1});
        switch ($sParam) {
            case 'g':
                $iMaxFileSize *= 1024;
            // no break
            case 'm':
                $iMaxFileSize *= 1024;
            // no break
            case 'k':
                $iMaxFileSize *= 1024;
        }

        // formatting
        $aMarkers = ['KB', 'MB', 'GB'];
        $sFormattedMaxSize = '';

        $iSize = floor($iMaxFileSize / 1024);
        while ($iSize && current($aMarkers)) {
            $sFormattedMaxSize = $iSize . " " . current($aMarkers);
            $iSize = floor($iSize / 1024);
            next($aMarkers);
        }

        return [$iMaxFileSize, $sFormattedMaxSize];
    }
protected function _getMaxUploadFileInfo($iMaxFileSize, $blFormatted = false)
    {
        $iMaxFileSize = $iMaxFileSize ? $iMaxFileSize : '2M';

        // processing config
        $iMaxFileSize = trim($iMaxFileSize);
        $sParam = strtolower($iMaxFileSize{strlen($iMaxFileSize) - 1});
        switch ($sParam) {
            case 'g':
                $iMaxFileSize *= 1024;
            // no break
            case 'm':
                $iMaxFileSize *= 1024;
            // no break
            case 'k':
                $iMaxFileSize *= 1024;
        }

        // formatting
        $aMarkers = ['KB', 'MB', 'GB'];
        $sFormattedMaxSize = '';

        $iSize = floor($iMaxFileSize / 1024);
        while ($iSize && current($aMarkers)) {
            $sFormattedMaxSize = $iSize . " " . current($aMarkers);
            $iSize = floor($iSize / 1024);
            next($aMarkers);
        }

        return [$iMaxFileSize, $sFormattedMaxSize];
    }
protected function _getMaxUploadFileInfo ( $ iMaxFileSize , $ blFormatted = false ) { $ iMaxFileSize = $ iMaxFileSize ? $ iMaxFileSize : '2M' ; // processing config $ iMaxFileSize = trim ( $ iMaxFileSize ) ; $ sParam = strtolower ( $ iMaxFileSize { strlen ( $ iMaxFileSize ) - 1 } ) ; switch ( $ sParam ) { case 'g' : $ iMaxFileSize *= 1024 ; // no break case 'm' : $ iMaxFileSize *= 1024 ; // no break case 'k' : $ iMaxFileSize *= 1024 ; } // formatting $ aMarkers = [ 'KB' , 'MB' , 'GB' ] ; $ sFormattedMaxSize = '' ; $ iSize = floor ( $ iMaxFileSize / 1024 ) ; while ( $ iSize && current ( $ aMarkers ) ) { $ sFormattedMaxSize = $ iSize . " " . current ( $ aMarkers ) ; $ iSize = floor ( $ iSize / 1024 ) ; next ( $ aMarkers ) ; } return [ $ iMaxFileSize , $ sFormattedMaxSize ] ; }
Returns maximum allowed size of upload file and formatted size equivalent

@param int  $iMaxFileSize recommended maximum size of file (normalu value is taken from php ini, otherwise sets 2MB)
@param bool $blFormatted  Return formated

@return array
Returns maximum allowed size of upload file and formatted size equivalent