diff --git a/app/common/library/Upload.php b/app/common/library/Upload.php index c650b1cc..45d6e58c 100644 --- a/app/common/library/Upload.php +++ b/app/common/library/Upload.php @@ -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, diff --git a/config/upload.php b/config/upload.php index 794c5994..aa54cef4 100644 --- a/config/upload.php +++ b/config/upload.php @@ -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', ]; \ No newline at end of file