Mobile app version of vmapp.org
Login or Join
Deb1703797

: How do I increase the upload size in IIS? 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.

@Deb1703797

Posted in: #AspNet #Iis #Iis7 #Microsoft #Windows

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.
; 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.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Deb1703797

2 Comments

Sorted by latest first Latest Oldest Best

 

@Angie530

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.

10% popularity Vote Up Vote Down


 

@Heady270

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

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme