perf:上传文件使用部分文件名作为前缀以便识别

This commit is contained in:
妙码生花 2023-07-12 20:36:51 +08:00
parent 36d332baa0
commit e95d03fa0b
2 changed files with 2 additions and 2 deletions

View File

@ -186,7 +186,7 @@ class Upload
'{sec}' => date("s"),
'{random}' => Random::build(),
'{random32}' => Random::build('alnum', 32),
'{filename}' => substr($filename, 0, 100),
'{filename}' => substr($filename, 0, 15),
'{suffix}' => $suffix,
'{.suffix}' => $suffix ? '.' . $suffix : '',
'{filesha1}' => $sha1,

View File

@ -7,7 +7,7 @@ return [
// 最大上传
'maxsize' => '10mb',
// 文件保存格式化方法
'savename' => '/storage/{topic}/{year}{mon}{day}/{filesha1}{.suffix}',
'savename' => '/storage/{topic}/{year}{mon}{day}/{filename}{filesha1}{.suffix}',
// 文件格式限制
'mimetype' => 'jpg,png,bmp,jpeg,gif,webp,zip,rar,xls,xlsx,doc,docx,wav,mp4,mp3,txt',
];