Increasing the Maximum File Upload Size

Overview

When you need to upload files larger than the 28MB default limit, you need to make changes to the web.config file. This article describes the process of increasing the maximum length of the content that can be uploaded on a site. 

 

Prerequisites

 


 

Diagnosis

If you try to upload a file to the site larger than 28MBs, you'll receive an upload error preventing you from completing the upload.

To reproduce the issue, you must:

  1. Go to Content > Assets > Select the Main Portal Folder.
  2. Click Asset > Upload the file.

 

Solution

To increase the maximum content length for your site, follow the procedure mentioned below:

  1. Locate the web.config file that is typically present in the root folder of your site.

  2. Add the following parameters to the web.config file. For example, we are increasing the max upload size to 70MB. The value in bold is in bytes:

     <system.webServer>
    ...
    <security>
    ...
    <requestFiltering>
    <requestLimits maxAllowedContentLength="73400320"/>
    </requestFiltering>
    </security>
    </system.webServer>
  3. If you are unable to find maxAllowedContentLength in your web.config, you must enable Request Filtering in your Windows Features and go into the Request Filtering feature in IIS and save a small change which should append the settings into the web.config file.
  4. You also need to confirm that the maxRequestLength has been increased. The value in bold is in KB
    <httpRuntime targetFramework="4.5" shutdownTimeout="120"
        executionTimeout="1200" useFullyQualifiedRedirectUrl="true" 
    maxRequestLength="71680" requestLengthDiskThreshold="28672"
    maxUrlLength="2048" requestPathInvalidCharacters="&lt;,&gt;,*,%,:,\,?" enableVersionHeader="false" requestValidationMode="2.0" fcnMode="Single" />
  5. After making the changes in the web.config file, increase the maximum size in DNN. To do so, navigate to Settings > Security.

    DNN.PNG

  6. Navigate to More > More Security Settings, change the value of Max Upload Size (MB), and click Save.

 

Notes: 
  • The value in the web.config file is in bytes, while the value inside the DNN configuration is in Megabytes.

 

Testing

You should be able to test that a larger file can be uploaded by uploading for the example above, a 70MB file to the Assets section in the Persona Bar.

This can be done by following the steps laid out in the Diagnosis section.

 

Back to Top 

Comments

1 comment

  • Avatar
    Fabio Adriano Gouvea

    Hi there.

    I'm using DNN Platform 9.5 and tried this procedurelaid out here, but right at "Diagnosis" I got puzzled as the Persona Bar in my installation doesn't have a "Assets" link under "Content". I only got "Pages" and "Recycle Bin". It's a Windows 10 installation with IIS10 and MSSqlServer 2019. After you procede with a standard installation process, shouldn't this manu link be available right out of the box along with "Pages" and "Recycle Bin"?

    0
    Comment actions Permalink

Please sign in to leave a comment.