当前位置:网站首页>UEditor之——图片上传组件大小4M的限制
UEditor之——图片上传组件大小4M的限制
2022-04-23 10:36:00 【冰河技术】
一般来说网站图片最好不要上传大于4M
的,但是有些特殊情况除外,如网站需要上传大图供下载等。
现维护的一网站后台使用了ueditor
编辑器插件,要求图片上传不要限制4M
,所以根据后台上传图片功能时网络加载的情况,判断是在前台控制的限制,就在/ueditor/dialogs/image/
目录下分别找了image.js
和image.html
,在image.html
里面找到了下面的配置变量:
var flashOptions = {
container:"flashContainer", //flash容器id
url:editor.options.imageUrl, // 上传处理页面的url地址
ext:'{"param1":"value1", "param2":"value2"}', //可向服务器提交的自定义参数列表
fileType:'{"description":"'+lang.fileType+'", "extension":"*.gif;*.jpeg;*.png;*.jpg"}', //上传文件格式限制
flashUrl:'imageUploader.swf', //上传用的flash组件地址
width:608, //flash的宽度
height:272, //flash的高度
gridWidth:121, // 每一个预览图片所占的宽度
gridHeight:120, // 每一个预览图片所占的高度
picWidth:100, // 单张预览图片的宽度
picHeight:100, // 单张预览图片的高度
uploadDataFieldName:editor.options.imageFieldName, // POST请求中图片数据的key
picDescFieldName:'pictitle', // POST请求中图片描述的key
maxSize:4, // 文件的最大体积,单位M
compressSize:2, // 上传前如果图片体积超过该值,会先压缩,单位M
maxNum:32, // 单次最大可上传多少个文件
compressSide:editor.options.compressSide, //等比压缩的基准,0为按照最长边,1为按照宽度,2为按照高度
compressLength:editor.options.maxImageSideLength //能接受的最大边长,超过该值Flash会自动等比压缩
};
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
只需要把flashOptions
里面的maxSize
改为大一些的值就行了。另外图片上传组件使用flash
压缩,质量不能保证,可以把compressSize
值也相应调大,更符合业务需求。 新版本(
v>=1.4.2
)的
ueditor
图片上传等等的配置,统一在
/ueditor/php/config.json
调整,看注释就能改。
版权声明
本文为[冰河技术]所创,转载请带上原文链接,感谢
https://blog.51cto.com/binghe001/5247934
边栏推荐
- 24、两两交换链表中的节点(链表)
- 101. Symmetric Tree
- 349. Intersection of two arrays
- Shell script interaction free
- Leetcode22:括号生成
- Ansible cloud computing automation
- Exercise questions and simulation test of refrigeration and air conditioning equipment operation test in 2022
- JVM——》常用参数
- Realize data value through streaming data integration (3) - real-time continuous data collection
- DBA common SQL statements (2) - SGA and PGA
猜你喜欢
C语言——自定义类型
JUC concurrent programming 07 -- is fair lock really fair (source code analysis)
Introduction to wechat applet, development history, advantages of applet, application account, development tools, initial knowledge of wxml file and wxss file
Cve-2019-0708 vulnerability exploitation of secondary vocational network security 2022 national competition
一文看懂 LSTM(Long Short-Term Memory)
net start mysql MySQL 服务正在启动 . MySQL 服务无法启动。 服务没有报告任何错误。
高价买来的课程,公开了!phper资料分享
JVM——》常用命令
Examination questions and answers of the third batch (main person in charge) of Guangdong safety officer a certificate in 2022
JVM - common parameters
随机推荐
Problems of class in C # and database connection
24、两两交换链表中的节点(链表)
Introduction to data analysis 𞓜 kaggle Titanic mission (III) - > explore data analysis
SSH利用私钥无密钥连接服务器踩坑实录
JUC concurrent programming 07 -- is fair lock really fair (source code analysis)
What if Jerry's function to locate the corresponding address is not accurate sometimes? [chapter]
SQL Server 递归查询上下级
How can swagger2 custom parameter annotations not be displayed
Reading integrity monitoring techniques for vision navigation systems - 3 background
SQL Server recursive query of superior and subordinate
SQL tuning series - Introduction to SQL tuning
Cve-2019-0708 vulnerability exploitation of secondary vocational network security 2022 national competition
IDEA——》每次启动都会Indexing或 scanning files to index
MapReduce compression
242. Valid Letter ectopic words (hash table)
LeetCode-608. Tree node
【leetcode】199. Right view of binary tree
C language - custom type
任意文件读取漏洞 利用指南
【省选联考 2022 D2T1】卡牌(状态压缩 DP,FWT卷积)