限制上传大小20M
This commit is contained in:
parent
b163364831
commit
fa5394ce81
@ -25,10 +25,7 @@ class UploadService
|
||||
$fileSize = $file->getSize();
|
||||
|
||||
if ($fileSize > 20 * 1024 * 1024){
|
||||
return [
|
||||
'code' => ResponseCode::FAIL,
|
||||
'msg' => '图片超出20M',
|
||||
];
|
||||
throw new Exception('文件超出20M');
|
||||
}
|
||||
|
||||
$uploadDir = '/files/' . $type . '/' . date('Ym') . '/';
|
||||
@ -82,10 +79,7 @@ class UploadService
|
||||
$fileSize = $file->getSize();
|
||||
|
||||
if ($fileSize > 20 * 1024 * 1024){
|
||||
return [
|
||||
'code' => ResponseCode::FAIL,
|
||||
'msg' => '文件超出20M',
|
||||
];
|
||||
throw new Exception('文件超出20M');
|
||||
}
|
||||
$origin_name = $file->getUploadName();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user