mirror of
https://github.com/Karaka-Management/oms-Media.git
synced 2026-02-18 02:08:40 +00:00
log invaid upload permission/file
This commit is contained in:
parent
4ff9b1f93e
commit
d211936a37
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Orange Management
|
* Orange Management
|
||||||
*
|
*
|
||||||
|
|
@ -10,12 +11,13 @@
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
* @link https://orange-management.org
|
* @link https://orange-management.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Modules\Media\Models;
|
namespace Modules\Media\Models;
|
||||||
|
|
||||||
use phpOMS\System\File\FileUtils;
|
|
||||||
use phpOMS\System\File\Local\Directory;
|
use phpOMS\System\File\Local\Directory;
|
||||||
|
use phpOMS\Log\FileLogger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Upload.
|
* Upload.
|
||||||
|
|
@ -169,7 +171,11 @@ class UploadFile
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!\is_dir($path)) {
|
if (!\is_dir($path)) {
|
||||||
Directory::create($path, 0755, true);
|
$created = Directory::create($path, 0755, true);
|
||||||
|
|
||||||
|
if (!$created) {
|
||||||
|
FileLogger::getInstance()->error('Couldn\t upload media file. There maybe is a problem with your permission or uploaded file.');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!\rename($f['tmp_name'], $dest = $path . '/' . $this->fileName)) {
|
if (!\rename($f['tmp_name'], $dest = $path . '/' . $this->fileName)) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user