超出upload_max_filesize 限制
超出upload_max_filesize 限制
By 口米口米爱
at 2017-09-05
0人收藏 • 3481人看过
@lincanbin 怎么把上传限制弄到 5M
- 登录后方可回帖
17 个回复 | 最后更新于 2017-09-05
回复#1 @lincanbin :
懵圈了,web server 是哪里? PHP 是哪里?upload的json配置文件是哪个?
回复#1 @lincanbin :
不是直接在参数设置就可以了么?
回复#1 @lincanbin :
回复#3 @口米口米爱 :
百度搜索 php上传文件大小限制
回复#1 @lincanbin :
直接上传手机拍的照片有2MB-4MB,直接上传的话carbon forum会不会帮忙压缩小点?怎么设置压缩比例?
回复#5 @天使没有心跳 :
恩,好的
回复#6 @口米口米爱 :
上面也有压缩参数。
回复#8 @lincanbin :
哪里?php.ini?
回复#9 @口米口米爱 :
那个json文件
回复#10 @lincanbin :
没找到json
回复#10 @lincanbin :
哈哈,找到了,可是该哪里呢?压缩比例?
<?php SetStyle('api', 'API'); switch (Request('Request', 'action')) { case 'get_notifications': Auth(1); header("Cache-Control: no-cache, must-revalidate"); @set_time_limit(0); //如果是自己的服务器,建议调大超时时间,然后把长连接时长调大,以节约服务器资源 $Config['PushConnectionTimeoutPeriod'] = intval((intval($Config['PushConnectionTimeoutPeriod']) < 22) ? 22 : $Config['PushConnectionTimeoutPeriod']); while ((time() - $TimeStamp) < $Config['PushConnectionTimeoutPeriod']) { if ($MCache) { $CurUserInfo = $MCache->get(MemCachePrefix . 'UserInfo_' . $CurUserID); if ($CurUserInfo) { $CurNewNotification = $CurUserInfo['NewNotification']; } else { $TempUserInfo = $DB->row("SELECT *, (NewReply + NewMention + NewMessage) as NewNotification FROM " . PREFIX . "users WHERE ID = :UserID", array( "UserID" => $CurUserID )); $MCache->set(MemCachePrefix . 'UserInfo_' . $CurUserID, $TempUserInfo, 86400); $CurNewNotification = $TempUserInfo['NewNotification']; } } else { $CurNewNotification = $DB->single("SELECT (NewReply + NewMention + NewMessage) AS NewNotification FROM " . PREFIX . "users WHERE ID = :UserID", array( "UserID" => $CurUserID )); } if ($CurNewNotification > 0) { break; } sleep(3); } echo json_encode(array( 'Status' => 1, 'NewMessage' => $CurNewNotification )); break; case 'get_tags': Auth(1); require(LibraryPath . "PHPAnalysis.class.php"); $str = Request('Post', 'Title') . "/r/n" . Request('Post', 'Content'); $do_fork = $do_unit = true; $do_multi = $do_prop = $pri_dict = false; //初始化类 PhpAnalysis::$loadInit = false; $pa = new PhpAnalysis('utf-8', 'utf-8', $pri_dict); //载入词典 $pa->LoadDict(); //执行分词 $pa->SetSource($str); $pa->differMax = $do_multi; $pa->unitWord = $do_unit; $pa->StartAnalysis($do_fork); $ResultString = $pa->GetFinallyResult('|', $do_prop); $tags = array(); $tags['status'] = 0; if ($ResultString) { foreach (explode('|', $ResultString) as $key => $value) { if ($value != '' && !is_numeric($value) && mb_strlen($value, "utf-8") >= 2) { $SQLParameters[] = $value; } } $TagsLists1 = $DB->column("SELECT Name FROM " . PREFIX . "tags Where Name IN (?)", $SQLParameters); $TagsLists2 = $DB->column("SELECT Title FROM " . PREFIX . "dict Where Title IN (?) Group By Title", $SQLParameters); //$TagsLists2 = array(); $TagsLists = array_merge($TagsLists1, array_diff($TagsLists2, $TagsLists1)); //获取热门话题 $TagsLists = array_merge($TagsLists, ArrayColumn($HotTagsArray, 'Name')); if ($TagsLists) { $tags['status'] = 1; rsort($TagsLists); $tags['lists'] = $TagsLists; } } echo json_encode($tags); break; case 'tag_autocomplete': //Auth(1); $Keyword = Request('Post', 'query'); $Response = array(); $Response['query'] = 'Unit'; $Result = $DB->column("SELECT Title FROM " . PREFIX . "dict WHERE Title LIKE :Keyword limit 10", array( "Keyword" => $Keyword . "%" )); if ($Result) { foreach ($Result as $key => $val) { $Response['suggestions'][] = array( 'value' => $val, 'data' => $val ); } } else { $Response['suggestions'][] = ''; } echo json_encode($Response); break; case 'user_exist': $UserName = strtolower(Request('Post', 'UserName')); $UserExist = $DB->single("SELECT ID FROM " . PREFIX . "users WHERE UserName = :UserName", array( 'UserName' => $UserName )); echo json_encode(array( 'Status' => $UserExist ? 1 : 0 )); break; case 'get_post': $PostId = intval(Request('Post', 'PostId')); $row = $DB->row("SELECT UserName, Content, TopicID FROM " . PREFIX . "posts WHERE ID = :PostId AND IsDel = 0", array( 'PostId' => $PostId )); if ($CurUserRole < 4) { // 对超级管理员以下的用户需要检查整个主题是否被删除了 $TopicID = $row['TopicID']; $TopicRow = $DB->single("SELECT COUNT(*) FROM " . PREFIX . "topics WHERE ID = :TopicID AND IsDel = 0", array( 'TopicID' => $TopicID )); if ($TopicRow < 1) { $row = false; } } echo json_encode($row); break; default: # code... break; }
回复#12 @口米口米爱 :
不在这。
回复#10 @lincanbin :
看了遍一堆堆的代码,对林大大的敬佩之情油然而生!
而且这么牛X的人就在和我聊天!
回复#13 @lincanbin :
在哪?
回复#15 @口米口米爱 :
3楼