DISCUZX no legal file to be uploaded solution

Source: Internet
Author: User

Solutions

source/class/discuz/discuz_upload.php

Edit this file to

Because the program limits the large size (refers to the resolution) attachment picture, the prompt "No legal file is uploaded"
How to change: sourceclassdiscuzclass_upload.php
Found it:

The code is as follows Copy Code

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;
}
}


The problem can be solved by changing 16777216 in the IF ($size > 16777216 | | $size < 16).
16777216 is about 5000*3356.


16777216 change the big can.

Error:500 's mistake.

The solution is to edit the php.ini file

Will

Memory_limit set larger, until the picture can be uploaded smoothly.

If it is a virtual host user, do not have the right to modify the php.ini file, please contact service provider to resolve, if the service provider does not resolve, consider turning off the image of the function of abbreviations.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.