When we upload a large file in asp.net using file upload control we got a error.so how to over come this ? The Default size of Asp.Net is 4MB.
Code
In Web.Config put this code.
- <system.web>
- <httpRuntime maxRequestLength="1048576" executionTimeout="600" />
- </system.web>
- <system.webServer>
- <security>
- <requestFiltering><requestLimits maxAllowedContentLength="3000000000" /></requestFiltering>
- </security>
- </system.webServer>
The below code maxRequestLength measured in kilobytes.Here is an example with a 1GB request length and a 10 minute request timeout:
- <httpRuntime maxRequestLength="1048576" executionTimeout="600" />
The below code
maxAllowedContentLength measured in bytes.
- <requestLimits maxAllowedContentLength="3000000000" />