0

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:

<configuration>
  <system.web>
    <httpRuntime maxRequestLength="xxx" />
  </system.web>
</configuration>

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 '14 at 14:08
  • I am still having this issue. Anyone? – William Edwards Nov 13 '14 at 16:40
  • Are you trying to do this at the Server Level Or the Site Level? – eyoung100 Nov 13 '14 at 16:58
  • @eyoung100 Don't care, as long as it works :P – William Edwards Nov 13 '14 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 '14 at 17:19
2

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.

0

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: http://at1.php.net/manual/en/ini.core.php#ini.post-max-size

  • Yes, I have, without effect. – William Edwards Oct 23 '14 at 14:59
  • (As you can see in the question.) – William Edwards Oct 23 '14 at 15:41
  • Sorry it didn't help, but your question doesn't mention that you tried this. – Acrklor Oct 23 '14 at 15:52
  • Thanks for trying, but it does... (the last one) – William Edwards Oct 23 '14 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 '14 at 7:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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