Upload large files

Overview

Use this article to configure your Sitefinity CMS and ASP.NET Core Renderer to be able to upload large files, if needed.

IIS hosting

If you host both Sitefinity CMS and the Renderer application on the IIS, you must add the following configuration to the web.config files of both projects:

XML
<location path="forms/submit">
   <system.web>
     <httpRuntime maxRequestLength="6048000" executionTimeout="7200" maxUrlLength="102400" maxQueryStringLength="102400" requestValidationType="Telerik.Sitefinity.Security.Claims.CustomRequestValidator, Telerik.Sitefinity" />
   </system.web>
   <system.webServer>
     <security>
       <requestFiltering>
         <requestLimits maxAllowedContentLength="2147483648" />
         <!--2GB-->
       </requestFiltering>
     </security>
   </system.webServer>
 </location>

For more information, see Microsoft's documentation » IIS.

Standalone Renderer application

If you are running the ASP.NET Core Renderer as a standalone application for testing purposes, you can configure the maximum file size limitation.
For more information, see Microsoft's documentation » Kestrel maximum request body size.

In addition, add the following code in the Program.cs file of the Renderer application:
builder.Services.Configure<IISServerOptions>(options => {options.MaxRequestBodySize = int.MaxValue;});

Upload large files in Sitefinity CMS

For uploading large files in the CMS, you must add the following configuration to the web.config:

XML
<configuration>
 <location path="sf/system" inheritInChildApplications="false">
  <system.webServer>
      <security>
          <requestFiltering><!-- 1 GB -->
              <requestLimits maxAllowedContentLength="1073741824" />
          </requestFiltering>
      </security>
  </system.webServer>
 </location>

<system.webServer>
   <handlers>
       <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
   </handlers>

   <aspNetCore processPath="dotnet" arguments=".\SandboxWebApp.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
</system.webServer>

</configuration>

NOTE: Replace SandboxWebApp.dll is the name of the Renderer .dll.

Upload large files in forms

To upload large files through forms, you must add the following configuration to the web.config of the CMS:

XML
<configuration>
 <location path="forms/submit" inheritInChildApplications="false">
   <system.webServer>
       <security>
           <requestFiltering><!-- 1 GB -->
               <requestLimits maxAllowedContentLength="1073741824" />
           </requestFiltering>
       </security>
   </system.webServer>
 </location>

 <system.webServer>
   <handlers>
       <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
   </handlers>

   <aspNetCore processPath="dotnet" arguments=".\SandboxWebApp.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
 </system.webServer>
</configuration>

NOTE: Replace SandboxWebApp.dll is the name of the Renderer .dll.

Want to learn more?
Enhance your Sitefinity skills by enrolling in free training sessions. Become Sitefinity certified through Progress Education Community to strengthen your professional credentials.