Allow larger images/videos to be uploaded if they are going to be converted

- 변환 대상인 이미지나 동영상 파일은 용량 제한을 더 느슨하게 설정할 수 있도록 함
- 변환 후에 다시 용량을 체크하여 각 게시판의 업로드 정책 적용
- https://rhymix.org/qna/1926104
This commit is contained in:
Kijin Sung 2026-03-10 19:45:38 +09:00
parent 44cf008ac7
commit 94008fbe9b
10 changed files with 87 additions and 7 deletions

View file

@ -102,6 +102,15 @@ class FileController extends File
$module_config = FileModel::getFileConfig($module_srl);
$allowed_attach_size = $module_config->allowed_attach_size * 1024 * 1024;
$allowed_filesize = $module_config->allowed_filesize * 1024 * 1024;
if (!empty($module_config->pre_conversion_filesize) && !empty($module_config->pre_conversion_types))
{
$extension = strtolower(array_last(explode('.', $file_info['name'])));
if ($extension && in_array($extension, $module_config->pre_conversion_types))
{
$allowed_attach_size = ($allowed_attach_size - $allowed_filesize) + ($module_config->pre_conversion_filesize * 1024 * 1024);
$allowed_filesize = $module_config->pre_conversion_filesize * 1024 * 1024;
}
}
}
if ($total_size > $allowed_filesize)
{