How to: Increase the Maximum File Size for Upload in DNN Platform.
The maximum file size must be multiples of 1024.
- 1024 bytes = 1 kilobyte (KB)
- 1024 KB = 1 megabyte (MB)
- 1024 MB = 1 gigabyte (GB)
Steps
Update the
httpRuntime
tag with the maximum file size you want.Look for the
httpRuntime
tag.The default
httpRuntime
tag might look as follows:<httpRuntime targetFramework="4.5" shutdownTimeout="120" executionTimeout="1200" useFullyQualifiedRedirectUrl="true" maxRequestLength="29296" requestLengthDiskThreshold="81920" maxUrlLength="2048" requestPathInvalidCharacters="<,>,*,%,:,\,?" enableVersionHeader="false" requestValidationMode="2.0" fcnMode="Single" />
Replace the value of maxRequestLength with the maximum file size in KB.
Note
maxRequestLength is stored as kilobytes. Example: You can use 2097152 KB (equivalent to 2 GB).
On IIS7+ or on Cloud Services, if you need to upload files that are greater than 28 MB , add a
<system.webServer/>
node to specify the maxAllowedContentLength for requests.Note
maxAllowedContentLength is stored as bytes. Example: You can use 2147483647 bytes (equivalent to 2 GB).
Add the following node to your web.config:
<system.webServer> <security> <requestFiltering> <requestLimits maxAllowedContentLength="2147483647" /> </requestFiltering> </security> </system.webServer>
Save the web.config file.
Increase the time available for file Upload
When you increase the Maximum File Size for Upload in DNN Platform to a very high value, you could run into other limitations. There is a maximum time a request can run before it's stopped by .NET As larger files can take a while to upload, you could run into this after you changed the maxRequestLength, especially on slower connections. To increase the Execution Timeout, look for the "executionTimeout" entry in web.config and change it accordingly. This executionTimeout value is stored in seconds.