0

I have created a custom error page for 404.13, which is what occurs when a user attempts to upload a file larger than a size set in the config files under maxAllowedContentLength. I want my .aspx file to say something like:

Maximum allowed file size=________KB

Trouble is, I can't figure out how to get the value from a server config file onto my .aspx page. Any ideas?

3
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by sknake
0

Hi,
Verify the configuration/system.webServer/security/requestFiltering/requestLimits@maxAllowedContentLength setting in the applicationhost.config or web.config file

0

Try this:

%windir%\system32\inetsrv\appcmd set config -section:requestFiltering -requestLim
its.maxAllowedContentLength:1000000

or if you only want to set it for your app:

%windir%\system32\inetsrv\appcmd set config "Default Web Site/<your app>" -section:requestFiltering -requestLimits.maxAllowedContentLength:1000000

Hope this helps

0

Now in order to get this to work u have to modify the overrideModeDefault from "Deny" to "Allow" like so:

<section name="requestFiltering" overrideModeDefault="Allow" />

:)

0

Why not just move it over as a constant? I don't think the value set in your configuration is the final word in determining upload size however. IIS can inherit settings from machine-wide policies, override parent directories, etc. So I think there is probably an API call you should be looking for but I can't seem to find it either.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.