龙网论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 147|回复: 1
收起左侧

[DZ] DZ上传大尺寸图片提示“没有合法的文件被上传” 解决办...

[复制链接]
发表于 2015-8-21 16:01 | 显示全部楼层 |阅读模式
由于程序限制了大尺寸(指分辨率)附件图片,提示 “没有合法的文件被上传”
更改方法:source\class\discuz\class_upload.php
找到:

function get_image_info($target, $allowswf = false) {
                $ext = discuz_upload::fileext($target);
                $isimage = discuz_upload::is_image_ext($ext);
                if(!$isimage && ($ext != 'swf' || !$allowswf)) {
                        return false;
                } elseif(!is_readable($target)) {
                        return false;
                } elseif($imageinfo = @getimagesize($target)) {
                        list($width, $height, $type) = !empty($imageinfo) ? $imageinfo : array('', '', '');
                        $size = $width * $height;
                        if($size > 16777216 || $size < 16 ) {
                                return false;
                        } elseif($ext == 'swf' && $type != 4 && $type != 13) {
                                return false;
                        } elseif($isimage && !in_array($type, array(1,2,3,6,13))) {
                                return false;
                        }
                        return $imageinfo;
                } else {
                        return false;
                }
        }


将 if($size > 16777216 || $size < 16 )  中16777216后即可解决问题。
16777216大约为5000*3356。


参考:http://www.moke8.com/article-5075-1.html
 楼主| 发表于 2015-8-21 16:15 | 显示全部楼层
DZX3.2应该是discuz_upload.php这个文件
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|龙网论坛 ( 辽ICP备06014320号 )

GMT+8, 2024-4-25 17:12

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表