So while developing an ASP.NET MVC Web application you might face this error because of the maximum default length of a web request is exceeded in terms of customers. So I am going to tell you how you can fix it by simply modifying your web.config file:

If you are using IIS for hosting your application add this in your web.config to increase the size.



<httpRuntime maxRequestLength="1048576" />



If you are using IIS 7 or above add this code too.




<requestLimits maxAllowedContentLength="1073741824" />




  • maxRequestLength is measured in kilobytes
  • maxAllowedContentLength is measured in bytes