Discuz X2批量上传提示100%完成后附件上传失败:

很奇怪,网上也看了很多发现都不适用。

无意中发现Discuz X2的安装目录下的error_log有更新,日期是今天的日期,就打开看了下:
[22-Apr-2013 00:03:21] PHP Warning: POST Content-Length of 12893419 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
[22-Apr-2013 00:07:18] PHP Warning: POST Content-Length of 12893419 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
[22-Apr-2013 00:07:56] PHP Warning: POST Content-Length of 11955733 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
[22-Apr-2013 00:10:06] PHP Warning: POST Content-Length of 10398132 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
[22-Apr-2013 00:13:36] PHP Warning: POST Content-Length of 12893419 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
原来如此,是上传附件的大小超过系统的默认值了。用phpinfo看了发现upload_max_filesize是2M。因为我上传的几个都是10M以上的,所以需要修改upload_max_filesize的大小,方法是php.ini中写上:
post_max_size = 20M
file_uploads = On
upload_max_filesize = 15M

保存之后再上传附件发现OK了。

网络任我行(www.urbansh.com)原创,转载请注明出处http://www.urbansh.com/discuz-x2-100-failed.html