如何使用 CKFinder 更改 Drupal CKEditor 模块的最大上传大小?
通过 CKFinder 中的 CKEditor 进行的所有上传都会在超出特定大小时返回消息“无效文件。文件大小太大。”,即使我已将每个位置的最大大小定义为 10MB想到。
/sites/all/modules/ckeditor/ckfinder/config.php
每个资源类型的 maxSize var 设置为 15728640 字节。 例如,
$config['ResourceType'][] = Array(
'name' => 'Files', // Single quotes not allowed
'url' => $baseUrl . 'files',
'directory' => $baseDir . 'files',
'maxSize' => '10M',
'allowedExtensions' => '7z,aiff,asf,avi,bmp,csv,doc,docx,fla,flv,gif,gz,gzip,jpeg,jpg,mid,mov,mp3,mp4,mpc,mpeg,mpg,ods,odt,pdf,png,ppt,pptx,pxd,qt,ram,rar,rm,rmi,rmvb,rtf,sdc,sitd,swf,sxc,sxw,tar,tgz,tif,tiff,txt,vsd,wav,wma,wmv,xls,xlsx,zip',
'deniedExtensions' => '');
我在 /sites/all/modules/ckeditor/ckfinder/plugins/fileeditor/plugin.js 中找到了一个 maxSize var,我已经修改了它,但没有运气。
phpinfo() 显示以下相关设置:
post_max_size:20M
upload_max_filesize: 10M
对于 10MB 的上传来说,这两个值都应该没问题。
我还能改变什么来解决这个问题?
All uploads made through CKEditor in CKFinder return the message "Invalid file. The file size is too big." when they exceed a certain size, even though I have defined the maximum size to 10MB every place I can think of.
/sites/all/modules/ckeditor/ckfinder/config.php
Every resource type has their maxSize var set to 15728640 bytes.
e.g.
$config['ResourceType'][] = Array(
'name' => 'Files', // Single quotes not allowed
'url' => $baseUrl . 'files',
'directory' => $baseDir . 'files',
'maxSize' => '10M',
'allowedExtensions' => '7z,aiff,asf,avi,bmp,csv,doc,docx,fla,flv,gif,gz,gzip,jpeg,jpg,mid,mov,mp3,mp4,mpc,mpeg,mpg,ods,odt,pdf,png,ppt,pptx,pxd,qt,ram,rar,rm,rmi,rmvb,rtf,sdc,sitd,swf,sxc,sxw,tar,tgz,tif,tiff,txt,vsd,wav,wma,wmv,xls,xlsx,zip',
'deniedExtensions' => '');
I found a maxSize var in /sites/all/modules/ckeditor/ckfinder/plugins/fileeditor/plugin.js as well which I have modified, no luck.
phpinfo() shows the following relevant settings:
post_max_size: 20M
upload_max_filesize: 10M
Both of which should be fine for 10MB uploads.
What else can I change to fix this?!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您是否查看过:管理/设置/上传?那里有一些最大文件大小设置。
Have you looked at: admin/settings/uploads ? There're some max file size settings there.
事实证明这是我的托管设置的问题。在绝望中,我向网络主机发送了电子邮件寻求想法,尽管我的 phpinfo() 正确地报告了这些变量,但他们告诉我:
我不太明白,但现在它可以工作了,Drupal 设置本身不需要改变。感谢大家的帮助。 (作为参考,这是 http://canadianwebhosting.com)
So it turns out that this was a problem with my hosting settings. In an act of desperation, I e-mailed the web host for ideas, and although my phpinfo() was reporting those variables correctly, they told me this:
I don't quite understand, but now it works, it was nothing to change in the Drupal setup itself. Thanks for the help everyone. (for reference, this is with http://canadianwebhosting.com)
我想也许如果文件大小只是 10mb 多一点点,而你没有注意到它,那就是它被标记下来的原因。尝试增加设置
帖子最大大小:12M
upload_max_filesize: 12M
另请注意,如果 upload_max_filesize < post_max_size ,则上传的最大文件大小是 upload_max_filesize 指定的,
如果 upload_max_filesize > ; post_max_size ,则上传的最大文件大小为 post_max_size 指定的值。
I think maybe if the file size is just a teeeny weeeeny bit more of 10mb and you havent noticed it, thats why it gets flagged down. Try increasing the settings of
post_max_size: 12M
upload_max_filesize: 12M
also note that if upload_max_filesize < post_max_size , then max file size for upload is the one specified by upload_max_filesize
if upload_max_filesize > post_max_size , then max file size for upload is the one specified by post_max_size.