上传临时文件目录修改
This commit is contained in:
@@ -29,9 +29,10 @@ class Upload extends Api
|
||||
if (empty($files)) {
|
||||
$this->error('未上传文件');
|
||||
}
|
||||
$uploadPath = ROOT_PATH . 'public' . DS . 'uploads' . DS . 'temp';
|
||||
if (!is_dir($uploadPath)) {
|
||||
@mkdir($uploadPath, 0755, true);
|
||||
// 临时目录使用 runtime(位于 web 根目录之外,且已对 PHP 运行用户开放写权限)
|
||||
$uploadPath = RUNTIME_PATH . 'temp';
|
||||
if (!is_dir($uploadPath) && !@mkdir($uploadPath, 0775, true) && !is_dir($uploadPath)) {
|
||||
throw new Exception('上传临时目录创建失败或无写权限:' . $uploadPath);
|
||||
}
|
||||
|
||||
$urls = [];
|
||||
|
||||
Reference in New Issue
Block a user