29 June 2011

Maximum Request Length Exceeded ASP.NET

I got this error Maximum request length exceeded while i was trying to upload several files, or a single big size file. As default, max file upload size is 4MB.
We can easily have a solution by not touching our asp.net c# source code.

Just add a single line of code in your Web.config file, and you are done.

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


Now we will not get maximum request length exceeded error in asp.net.