How to increase default File Upload size in ASP.Net ? By default, ASP.Net restricts the file uploaded to the server to be 4 MB. We can increase this setting in Web.Config through the <httpRuntime> tag. The below configuration setting is configured for all default values.
<httpRuntime executionTimeout="110" maxRequestLength="4096" requestLengthDiskThreshold="80" useFullyQualifiedRedirectUrl="false" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="5000" enableKernelOutputCache="true" enableVersionHeader="true" requireRootedSaveAsPath="true" enable="true" shutdownTimeout="90" delayNotificationTimeout="5" waitChangeNotification="0" maxWaitChangeNotification="0" enableHeaderChecking="true" sendCacheControlHeader="true" apartmentThreading="false" /> To increase the default upload size, we need to increase the value of maxRequestLength property to whatever we want in KB. Default is 4096 KB(4MB).
To upload 100 MB, set maxRequestLength="102400"
Copy the above configuration inside <System.Web> tag in Web.Config.
|