Home  »  Articles  »  ASP.Net  »

How to increase the max upload file size in ASP.NET?

 Posted By : Manoranjan SahooPosted Date : 23/06/2017 04:44:11 PM Category : ASP.Net Points : 5

To increase the maximum upload file size limit in asp.net, we need to add below settings in web.config file.
<configuration>
  <system.web>
    <httpRuntime maxRequestLength="4096" />
  </system.web>
</configuration>
The default length is 4096 KB. You have to mentioned in KB.

For IIS 7+, as well as adding the "httpRuntime maxRequestLength" setting you also need to add:
<system.webServer>
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="10485760" /> <!--10MB-->
      </requestFiltering>
    </security>
  </system.webServer>
The "Maximum allowed content length" is always set in bytes. 

Thank you.




Responses
No responses found for this thread. Be the first to respond this thread.
Post Reply
Login to post Response.