
在PbootCMS日常使用过程中,会涉及一些非常见的文件格式上传。
这时候就需要在PbootCMS配置文件中追加一些允许上传文件扩展名。
操作步骤
1、打开/config/config.php文件,大约在30行,修改upload配置信息:
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' , |
|
如上,末尾追加,webp,mov
2、ueditor编辑器中,也会遇到这个情况,需要单独修改ueditor中的配置。
文件位置:/core/extend/ueditor/php/config.json,在文件中搜索 AllowFiles ,在该行末尾,按照规则补充相应的扩展名即可。
例如:
02 | "imageActionName" : "uploadimage" , /* 执行上传图片的action名称 */ |
03 | "imageFieldName" : "upfile" , /* 提交的图片表单名称 */ |
04 | "imageMaxSize" : 20480000, /* 上传大小限制,单位B,默认10MB */ |
05 | "imageAllowFiles" : [ ".png" , ".jpg" , ".jpeg" , ".gif" , ".bmp" , ".ico" , ".webp" ], /* 上传图片格式显示 */ |
06 | "imageCompressEnable" : false , /* 是否压缩图片,默认是 true */ |
07 | "imageCompressBorder" : 1600, /* 图片压缩最长边限制 */ |
08 | "imageInsertAlign" : "none" , /* 插入的图片浮动方式 */ |
09 | "imageUrlPrefix" : "" , /* 图片访问路径前缀 */ |
10 | "imagePathFormat" : "/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}" , /* 上传保存路径,可以自定义保存路径和文件名格式 */ |
11 | /* {filename} 会替换成原文件名,配置这项需要注意中文乱码问题 */ |
12 | /* {rand:6} 会替换成随机数,后面的数字是随机数的位数 */ |
21 | /* 非法字符 : * ? " < > | */ |
22 | /* 具请体看线上文档: fex.baidu.com/ueditor/ |
|
3、文件位置:/core/function/file.php,大约在287行,找到'exe', 删除
4、文件位置:/apps/admin/controller/system/ConfigController.php,大约在197行,找到|exe, 删除