Files
webman-buildadmin-mall/config/upload.php

26 lines
1.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
// +----------------------------------------------------------------------
// | BuildAdmin上传设置
// +----------------------------------------------------------------------
return [
// 最大上传
'max_size' => '10mb',
// 文件保存格式化方法:topic=存储子目录,fileName=文件名前15个字符
'save_name' => '/storage/{topic}/{year}{mon}{day}/{fileName}{fileSha1}{.suffix}',
/**
* 上传文件的后缀和 MIME类型 白名单
* 0. 永远使用最少配置
* 1. 此处不支持通配符
* 2. 千万不要允许 php,php5,.htaccess,.user.ini 等可执行或配置文件
* 3. 允许 pdf,ppt,docx 等可能含有脚本的文件时,请先从服务器配置此类文件直接下载而不是预览
*/
'allowed_suffixes' => 'jpg,png,bmp,jpeg,gif,webp,wav,mp4,mp3',
'allowed_mime_types' => [],
// 禁止上传的后缀(含双后缀检测,如 shell.php.jpg
'forbidden_suffixes' => 'php,php3,php4,php5,php7,php8,phtml,phar,htaccess,htpasswd,user.ini,asp,aspx,jsp,jspx,cgi,pl,sh,bat,cmd,exe,dll,vbs,ps1,com,shtml',
// 允许使用的上传驱动(禁止通过 driver 参数加载任意类)
'allowed_drivers' => 'local',
];