您好,欢迎来到12图资源库!分享精神,快乐你我!我们只是素材的搬运工!!
  • 首 页
  • 当前位置:首页 > 网站教程 > discuz教程 >
    Discuz! X2.5上传大尺寸图片提示“没有合法的文件被上传” 更改
    时间:2016-04-10 20:27 来源:12图资源库 作者:12too.com 浏览:收藏 挑错 推荐 打印

    由于程序限制了大尺寸附件图片,提示 “没有合法的文件被上传”
    更改方法: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更改大点

     

    (责任编辑:admin)