Eliminate php.ini restrictions on all file sizes

This commit is contained in:
Kijin Sung 2016-12-17 20:51:10 +09:00
parent e2895912e5
commit 193fab949d
3 changed files with 9 additions and 4 deletions

View file

@ -134,6 +134,7 @@ class fileAdminController extends file
else $file_config->download_grant = $download_grant;
//관리자가 허용한 첨부파일의 사이즈가 php.ini의 값보다 큰지 확인하기 - by ovclas
/*
$userFileAllowSize = FileHandler::returnbytes($file_config->allowed_filesize.'M');
$userAttachAllowSize = FileHandler::returnbytes($file_config->allowed_attach_size.'M');
$iniPostMaxSize = FileHandler::returnbytes(ini_get('post_max_size'));
@ -142,7 +143,8 @@ class fileAdminController extends file
if($userFileAllowSize > $iniMinSzie || $userAttachAllowSize > $iniMinSzie)
return new Object(-1, 'input size over than config in php.ini');
*/
$oModuleController = getController('module');
for($i=0;$i<count($module_srl);$i++)
{

View file

@ -175,6 +175,7 @@ class fileModel extends file
if(!$config->allow_outlink) $config->allow_outlink = 'Y';
if(!$config->download_grant) $config->download_grant = array();
/*
$size = ini_get('upload_max_filesize');
$unit = strtolower($size[strlen($size) - 1]);
$size = (float)$size;
@ -189,6 +190,7 @@ class fileModel extends file
{
$config->allowed_attach_size = $size;
}
*/
return $config;
}
@ -286,11 +288,13 @@ class fileModel extends file
if($logged_info->is_admin == 'Y')
{
/*
$iniPostMaxSize = FileHandler::returnbytes(ini_get('post_max_size'));
$iniUploadMaxSize = FileHandler::returnbytes(ini_get('upload_max_filesize'));
$size = min($iniPostMaxSize, $iniUploadMaxSize) / 1048576;
$file_config->allowed_attach_size = $size;
$file_config->allowed_filesize = $size;
*/
$file_config->allowed_filetypes = '*.*';
}
return $file_config;

View file

@ -10,15 +10,14 @@
<div class="x_control-group">
<label for="allowed_filesize" class="x_control-label">{$lang->allowed_filesize}</label>
<div class="x_controls">
<input type="number" min="0" name="allowed_filesize" id="allowed_filesize" value="{$file_config->allowed_filesize}" size="3" /> MB
<input type="number" min="0" name="allowed_filesize" id="allowed_filesize" value="{$file_config->allowed_filesize}" size="7" style="min-width:80px" /> MB
<p class="x_help-inline">{$lang->about_allowed_filesize}</p>
</div>
</div>
<div class="x_control-group">
<label for="allowed_attach_size" class="x_control-label">{$lang->allowed_attach_size}</label>
<div class="x_controls">
<input type="number" min="0" name="allowed_attach_size" id="allowed_attach_size" value="{$file_config->allowed_attach_size}" size="3" /> MB
/ {ini_get('upload_max_filesize')}
<input type="number" min="0" name="allowed_attach_size" id="allowed_attach_size" value="{$file_config->allowed_attach_size}" size="7" style="min-width:80px" /> MB
<p class="x_help-inline">{$lang->about_allowed_attach_size}</p>
</div>
</div>