2

I have changed the maxfile size in the php.ini settings, but i do not know how to change it in the IIS 10 config.

My hphinfo: enter image description here

I am getting the error 1 in the $_FILE array (which as I understand means that the request size exceeds the max allowed.

I am sending smaller files (ie 1M or 2M without any problems)

The POST request is generated by my software (it is an ucontroller controlled device) and here is no browser involved in it.

2
  • Can you please post the exact error? Also what is your upload_max_filesize value set to in php.ini?
    – Jarco
    Commented Apr 3, 2019 at 14:47
  • @Jarco upload_max_filesize -> 8M I think it is IIS problem. The error is 1 in the "error" ($_FILE variable) Commented Apr 3, 2019 at 15:10

2 Answers 2

2

From: https://www.inflectra.com/support/knowledgebase/kb306.aspx

By default, IIS web server allows for limited file size to be uploaded to the web server. For IIS 6 and IIS 7, the default maximum file upload size is 4 MB and 28.6 MB respectively. IIS 7 returns a 404 error (HTTP Error 404.13 - CONTENT_LENGTH_TOO_LARGE) if someone uploads something larger than 30MB. In order to allow for larger file size uploads, a few server changes are required.

Modify the maxAllowedContentLength setting in the web.config:

<system.webServer>
  <security>
    <requestFiltering>
      <requestLimits maxAllowedContentLength="2147483648" />
    </requestFiltering>
  </security>
</system.webServer>

With the above maxAllowedContentLength, users can upload files that are 2 GB in size. This setting will work right away without restart IIS services.

2
-2

Have a look at the "php.ini" file, where "upload_max_filesize" is set to "2M" by default. If you change "2M" by e.g. "10M", then your POST request shall work. Otherwise, the problem is somewhere else.

1
  • they say they already changed the max file size in php.ini. The comment says upload_max_filesize is set to 8MB Commented Jun 30, 2020 at 22:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.