Click here to Skip to main content
15,888,031 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I know it can be solved by increasing maxRequestLength in webconfig. but i am restricted to do so.

I am getting this error if i upload file greater then 5 MB.


Please suggest me any alternate way to do this without altering web.config.
Posted
Updated 3-Apr-23 18:51pm

1 solution

There's a default of 4MB max request length set in Machine.config , The only way you can override this is set the system.web -> httpRuntime in web.config for your application.

Try something like below in IIS 7

appcmd set config "My Site/MyApp" -section:requestFiltering -requestLimits.maxAllowedContentLength:104857600 -commitpath:apphost

Source - http://weblogs.asp.net/jgalloway/archive/2008/01/08/large-file-uploads-in-asp-net.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900