在PbootCMS日常使用过程中,会涉及一些非常见的文件格式上传。
这时候就需要在PbootCMS配置文件中追加一些允许上传文件扩展名。
操作步骤
1、打开/config/config.php文件,大约在30行,修改upload配置信息:
1// 上传配置 2 'upload' => array( 3 'format' => 'jpg,jpeg,png,gif,xls,xlsx,doc,docx,ppt,pptx,rar,zip,pdf,txt,mp4,avi,flv,rmvb,mp3,otf,ttf,webp,mov', 4 'max_width' => '1920', 5 'max_height' => '' 6 ), |
如上,末尾追加,webp,mov
2、ueditor编辑器中,也会遇到这个情况,需要单独修改ueditor中的配置。
文件位置:/core/extend/ueditor/php/config.json,在文件中搜索 AllowFiles ,在该行末尾,按照规则补充相应的扩展名即可。
例如:
01 02 "imageActionName": "uploadimage", 03 "imageFieldName": "upfile", 04 "imageMaxSize": 20480000, 05 "imageAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp", ".ico", ".webp"], 06 "imageCompressEnable": false, 07 "imageCompressBorder": 1600, 08 "imageInsertAlign": "none", 09 "imageUrlPrefix": "", 10 "imagePathFormat": "/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", 11 12 13 14 15 16 17 18 19 20 21 22 |
3、文件位置:/core/function/file.php,大约在287行,找到'exe', 删除
4、文件位置:/apps/admin/controller/system/ConfigController.php,大约在197行,找到|exe, 删除
