Uploading large files in ASP.NET Options

codeling 1263 - 5394
@2019-12-26 14:19:37

When you try to upload files to the Web server in a ASP.NET web application, the default maximum file size is 4096 KB (4 MB). If you want to upload files larger than 4MB, you need to add the following setting in Web.config.

<configuration>
    <system.web>
        <!-- max upload file size is 30mb(30720KB) -->
        <httpRuntime requestValidationMode="2.0"  maxRequestLength="30720"/>
    </system.web>
</configuration>

otherwise, you will see the following message thrown from the application:

"System.Web.HttpException: Maximum request length exceeded" 
 
Users browsing this topic
Guest