Use proper file storage path for skin uploads

This commit is contained in:
Kijin Sung 2018-12-18 16:03:27 +09:00
parent 6a9a884680
commit 930ebc97b7
2 changed files with 20 additions and 10 deletions

View file

@ -454,11 +454,11 @@ class moduleAdminController extends module
continue;
}
// Upload the file to a path
$path = sprintf("./files/attach/images/%s/", $module_srl);
$oFileController = getController('file');
$path = $oFileController->getStoragePath('images', getNextSequence(), $module_srl, 0, '', false);
// Create a directory
if(!FileHandler::makeDir($path)) return false;
$filename = $path.$image_obj['name'];
$filename = $path . Rhymix\Framework\Filters\FilenameFilter::clean($image_obj['name']);
// Move the file
if(!move_uploaded_file($image_obj['tmp_name'], $filename))
{