class="area">
由於程序限制了大尺寸附件圖片,提示 “沒有合法的文件被上傳”
更改方法: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更改大點