I can't upload more than 2 MB. I read that IIS' max. upload size is 4 (actually 4,2) GB and ASP.NET's is 2 GB.

I really can't think of an alternative. I could change the max. upload size in PHP but IIS isn't compatible with this causing the server not to accept uploads over 2 MB still.

But even if 4,2 GB can be uploaded, how can I configure that? I've tried everything but it just doesn't work!

I was also told that it can be increased via ASP.NET but I don't think it is to be honest. And even if, how?

What have I tried?

Change the web.config

I added this to the web.config file:

    <httpRuntime maxRequestLength="xxx" />

Request filtering

I went to IIS -> servername -> Sites -> sitename -> Request Filtering -> Edit Feature Settings... and changed the Maximum allowed content length (Bytes) field there. Is that the one I need to change?

Change it in PHP

I changed the upload_max_filesize section:

; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = xxxM

to something else in the php.ini. It increased the limit in PHP but IIS must be compatible with that change, which it isn't, unfortunately.

Yes, I restarted IIS every time I made a change, but without effect unfortunately.

The error message I get all the time is:

I suggested to my 'client' to use Apache but he wants to use IIS, so switching is not really an option.

  • Does implementing it this way help?
    – eyoung100
    Oct 13, 2014 at 14:08
  • I am still having this issue. Anyone?
    – William
    Nov 13, 2014 at 16:40
  • Are you trying to do this at the Server Level Or the Site Level?
    – eyoung100
    Nov 13, 2014 at 16:58
  • @eyoung100 Don't care, as long as it works :P
    – William
    Nov 13, 2014 at 17:04
  • Use the method I gave you above on a per site basis. You can't use this with the DEFAULT_WEB_SITE as the default doesn't read web.config
    – eyoung100
    Nov 13, 2014 at 17:19

3 Answers 3


You need to set maxAllowedContentLength, not maxRequestLength to up the allowed upload size for IIS. the former is the IIS request length limit, the latter is the ASP.NET request length limit.

Also important to know is that maxAllowedContentLength is the length in bytes, whereas maxRequestLength is the length in kilobytes.

See this question on SO for more info.


Did you change/increase post_max_size and memory_limit in the php.ini?
Both values also affect file upload size and must be larger than upload_max_filesize.

See the PHP documentation for further reference: https://www.php.net/manual/en/ini.core.php#ini.post-max-size

  • Yes, I have, without effect.
    – William
    Oct 23, 2014 at 14:59
  • (As you can see in the question.)
    – William
    Oct 23, 2014 at 15:41
  • Sorry it didn't help, but your question doesn't mention that you tried this.
    – Acrklor
    Oct 23, 2014 at 15:52
  • Thanks for trying, but it does... (the last one)
    – William
    Oct 23, 2014 at 20:12
  • You write you changed upload_max_filesize, doesn't say that you also aligned post_max_size and memory_limit variables to it.
    – Acrklor
    Oct 24, 2014 at 7:54

You can increase the upload size in following ways;

(1) One of the methods is

< system.webServer > 
  < security > 
    < requestFiltering > 
      < requestLimits maxAllowedContentLength= “214783648” / > 
    < / requestFiltering > 
  < / security > 
< / system.webBrowser >

(2) Using a GUI: http://www.web-site-scripts.com/knowledge-base/article/AA-00696/0/Increasing-maximum-allowed-size-for-uploads-on-IIS7.html

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.