server test version
This commit is contained in:
@ -36,7 +36,9 @@ class FileUpload
|
||||
$newFileName = md5(time() . $this->fileName) . '.' . $this->fileExtension;
|
||||
if (in_array($this->fileExtension, $this->allowedFileExtensions)) {
|
||||
$this->uploadDir = $uploadDir . mb_substr($newFileName, 0, 2) . '/' . mb_substr($newFileName, 2, 2) . '/';
|
||||
mkdir(ROOT_DIR . $this->uploadDir, 0777, true);
|
||||
$oldMask = umask(0);
|
||||
mkdir(ROOT_DIR . $this->uploadDir, 0775, true);
|
||||
umask($oldMask);
|
||||
$uploadFileDir = ROOT_DIR . $this->uploadDir;
|
||||
$this->destPath = $uploadFileDir . $newFileName;
|
||||
$this->uploadFile = $this->uploadDir . $newFileName;
|
||||
@ -49,7 +51,9 @@ class FileUpload
|
||||
} else {
|
||||
if (in_array($this->fileExtension, $this->allowedFileExtensions)) {
|
||||
$this->uploadDir = $uploadDir;
|
||||
mkdir(ROOT_DIR . $this->uploadDir, 0777, true);
|
||||
$oldMask = umask(0);
|
||||
mkdir(ROOT_DIR . $this->uploadDir, 0775, true);
|
||||
umask($oldMask);
|
||||
$uploadFileDir = ROOT_DIR . $this->uploadDir;
|
||||
$this->destPath = $uploadFileDir . $this->fileName;
|
||||
$this->uploadFile = $this->uploadDir . $this->fileName;
|
||||
|
Reference in New Issue
Block a user