网站之家技术交流论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 1223|回复: 0

Discuz! X2.5上传大尺寸图片提示“没有合法的文件被上传” 更改方法

[复制链接]
发表于 2016-11-17 11:51:34 | 显示全部楼层 |阅读模式
由于程序限制了大尺寸附件图片,提示 “没有合法的文件被上传”
更改方法:source\class\discuz\class_upload.php
找到:
  1. function get_image_info($target, $allowswf = false) {
  2.                 $ext = discuz_upload::fileext($target);
  3.                 $isimage = discuz_upload::is_image_ext($ext);
  4.                 if(!$isimage && ($ext != 'swf' || !$allowswf)) {
  5.                         return false;
  6.                 } elseif(!is_readable($target)) {
  7.                         return false;
  8.                 } elseif($imageinfo = @getimagesize($target)) {
  9.                         list($width, $height, $type) = !empty($imageinfo) ? $imageinfo : array('', '', '');
  10.                         $size = $width * $height;
  11.                         if($size > 16777216 || $size < 16 ) {
  12.                                 return false;
  13.                         } elseif($ext == 'swf' && $type != 4 && $type != 13) {
  14.                                 return false;
  15.                         } elseif($isimage && !in_array($type, array(1,2,3,6,13))) {
  16.                                 return false;
  17.                         }
  18.                         return $imageinfo;
  19.                 } else {
  20.                         return false;
  21.                 }
  22.         }
复制代码
将 if($size > 16777216 || $size < 16 )  中16777216更改大点
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|网站之家技术交流论坛 ( 粤ICP备09092995号 )

GMT+8, 2024-5-4 09:56 , Processed in 0.084526 second(s), 6 queries , File On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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