Optional Upload Configuration

FileUltimate does not depend on any Web.config settings to work (it's config-free for easy deployment). However for some cases (e.g. supporting legacy Html4 browsers), you may want to change request limits for uploads.

Chunked upload mode

This is the default mode on modern browsers, file is split into chunks and chunks are uploaded one by one, and then chunks are reassembled back on the server. The reason for using chunked uploading when possible, is to overcome server's default request limitations. By using chunking, normally you don't need to change any settings to allow uploading of very large files out of the box. Currently all upload methods except Html4 uses chunked uploading (Html5 or Flash or Silverlight).

The default and highest value for FileUploaderChunkSize is determined from Web.Config and is usually 28.6 MB (or 4MB for ASP.NET Classic before 4.5). FileUploader automatically overrides runtime request limits for ASP.NET Classic 4.5+ and ASP.NET Core but it's still limited by IIS (system.webServer) request limits.

If you need to change default and highest value for FileUploaderChunkSize for some reason (e.g. from 28.6 MB to 100 MB), you can increase the request size limits, as shown here.

Form upload mode

This mode is used for old browsers (legacy Html4 browsers, e.g. Internet Explorer 9), If you want to support the lowest level upload method Html4 which is the only possible method for old browsers without Html5 or Flash or Silverlight support, then you will need to increase the request size limits, as shown here so that you can upload files larger than 28.6 MB (or 4MB for ASP.NET Classic before 4.5) on these browsers. This is because Html4 cannot split into chunks and can only send the whole file in a single request (encoded as multipart/form-data).

Html4 upload method will be limited by the maximum possible value for request size, i.e. 4GB for ASP.NET Core or 2GB for ASP.NET Classic but other upload methods use chunking so there is no upper limit for them.

Increasing request size limits

Information on various request size limits:

  • IIS by default has 30000000 (28.6 MB) request size limit, controlled by system.webServer/requestLimits/maxAllowedContentLength property in Web.Config, in bytes, maximum value is 4294967295 (4 GB). This setting effects FileUploader, as it is an IIS setting, FileUploader cannot automatically override it.

    Although maxAllowedContentLength allows maximum value 4294967295 (4 GB), if the application is running under the NET 4.5 Integrated Pipeline Application Pool, upload will not work above 2 GB and the following error will be sent by IIS: "HTTP 400.0 – Bad Request ASP.NET detected invalid characters in the URL.". That's why 2147483647 (2 GB) should be used as the maximum value unless you switch to legacy Classic Pipeline Application Pool. For more details see this article.

  • ASP.NET Core by default has 30000000 (28.6 MB) request size limit, controlled by IHttpMaxRequestBodySizeFeature.MaxRequestBodySize property in code, in bytes, maximum value is unlimited if null. This setting does not effect FileUploader, i.e FileUploader can automatically override it.

  • ASP.NET Classic by default has 4096 (4 MB) request size limit, controlled by system.web/httpRuntime/maxRequestLength property in Web.Config, in kilobytes, maximum value is 2097151 (2 GB). This setting effects FileUploader only if you are running under server runtime lower than ASP.NET Classic 4.5 version, i.e when FileUploader cannot automatically override it.

Select a sub-section:

For an ASP.NET Core project

Edit your project's Web.config file and add the following settings inside <configuration> tag:

XML
<!-- This setting increases the request max size for whole application -->
<location path="." inheritInChildApplications="false">
  <system.webServer>
    <security>
      <requestFiltering>
        <!-- 
          maxAllowedContentLength is in bytes, default value is 30000000 (28.6 MB), maximum value is 4294967295 (4 GB).
          This setting effects FileUploader, as it is an IIS setting, FileUploader cannot automatically override it.
        -->
        <requestLimits maxAllowedContentLength="4294967295"/>
      </requestFiltering>
    </security>
  </system.webServer>
</location>

  Note

ASP.NET Core does not support paths other than root for location tag (can cause HTTP 404 error when the path is requested) so you need to use <location path="."> for ASP.NET Core.

For an ASP.NET Classic 4.5+ (MVC or WebForms) project

Edit your project's Web.config file and add the following settings inside <configuration> tag:

XML
<!-- This setting increases the request max size only for the specified path and not whole application -->
<location path="fileuploader.ashx">
  <system.webServer>
    <security>
      <requestFiltering>
        <!-- 
          maxAllowedContentLength is in bytes, default value is 30000000 (28.6 MB), maximum value is 4294967295 (4 GB).
          However maximum value is 2147483647 (2 GB) when the application is running under the NET 4.5 Integrated Pipeline Application Pool.
          This setting effects FileUploader, as it is an IIS setting, FileUploader cannot automatically override it.
        -->
        <requestLimits maxAllowedContentLength="2147483647"/>
      </requestFiltering>
    </security>
  </system.webServer>
</location>

For ASP.NET Classic before 4.5 (MVC or WebForms) project

Edit your project's Web.config file and add the following settings inside <configuration> tag:

XML
<!-- This setting increases the request max size only for the specified path and not whole application -->
<location path="fileuploader.ashx">
  <system.webServer>
    <security>
      <requestFiltering>
        <!-- 
          maxAllowedContentLength is in bytes, default value is 30000000 (28.6 MB), maximum value is 4294967295 (4 GB).
          However maximum value is 2147483647 (2 GB) when the application is running under the NET 4.5 Integrated Pipeline Application Pool.
          This setting effects FileUploader, as it is an IIS setting, FileUploader cannot automatically override it.
        -->
        <requestLimits maxAllowedContentLength="2147483647"/>
      </requestFiltering>
    </security>
  </system.webServer>
  <system.web>
    <!-- 
      maxRequestLength is in kilobytes, default value is 4096 (4 MB), maximum value is 2097151 (2 GB).
      This setting effects FileUploader only if you are running under server runtime lower than ASP.NET Classic 4.5 version, 
      i.e when FileUploader cannot automatically override it.
    -->
    <httpRuntime maxRequestLength="2097151"/>
  </system.web>
</location>