"Request Entity Too Large" Upload image size limit

Source: Internet
Author: User
Tags phpinfo

Yesterday the company Android app uploaded a picture exploded the following error

<"-//ietf//dtd HTML 2.0//en "><HTML><Head><title>413 Request Entity Too Large</title></Head><Body><H1>Request Entity Too Large</H1>The requested resource<BR/>/auth/upfile<BR/>does not allow request data with POST requests, or the amount of data provided inthe request exceeds the capacity Limi T.<HR><Address>apache/2.4.7 (Ubuntu) Server at www.baidu.cn Port 443</Address></Body></HTML>

View the parameters of php.ini with Phpinfo

Upload_max_filesize    20mpost_max_size    2M

Well, it looks like post_max_size limits the size of the last file.

So I set the php.ini limit upload file parameters

Upload_max_filesize    100mpost_max_size    8M

Using Phpinfo () to see if the discovery has not changed.

That's odd.

The. htaccess file under the project directory is then set, and the code is added.

<ifmodule mod_php5.c>50</ifmodule>

Again with Phpinfo () Look, this time has changed.

But after uploading, I still report this error.

Embarrassed by my brother.

After listening to the Android reflect that the test server can be uploaded, the official server is not available.

Then you see a hint error with a 443 port.

It dawned on me, is it the reason of https?

Change the keyword to search the data again.

Finally, I found this solution.

Http://stackoverflow.com/questions/18279007/413-request-entity-too-large-on-https

That's it.

In the domain name configuration file, modify the following file is added

<virtualhost *:443>   #  ...   <directory ...>        #...        # 8M    </Directory>    </VirtualHost>

Modified Apache server to receive the size of the data buffer, restart Apache done.

Ah haha haha, I am really a genius.

No, this should not be related to HTTPS!!!

My God!!!

"Request Entity Too Large" Upload image size limit

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.