Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 37 additions & 16 deletions 15/umbraco-cms/reference/configuration/maximumuploadsizesettings.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,56 @@
description: "Information on how to change the default cap of upload size"
---

Umbraco does not touch the default maximum allowed content size of the different services, but you can configure this yourself.
# Maximum Upload Size Settings

# Using IIS
Learn how to change the upload size limit for your Umbraco site depending on your hosting setup:

To configure the default 28.6MB upload limit using IIS, we have to create a web.config file at the root of the project. It should contain this:
- [Using IIS](#using-iis)
- [Hosting on Umbraco Cloud](#hosting-on-umbraco-cloud)
- [Using Kestrel](#using-kestrel)

By default, Umbraco does not restrict upload size. The limits are controlled by the hosting platform.

## Using IIS

The default upload limit in IIS is 30000000 bytes (~28.6 MB). The maximum value allowed is 4 GB.

To increase the upload limit:

1. Create or update the `web.config` file at the root of your project.
2. Add the following configuration:

```xml
<?xml version="1.0"?>
<configuration>
<system.webServer>
<security>
<requestFiltering>
<!-- ~ Below is the number of bytes allowed, 4GB is the maximum -->
<!-- 2 MB in bytes -->
<requestLimits maxAllowedContentLength="2000000" />
</requestFiltering>
</security>
</system.webServer>
</configuration>
```

`maxAllowedContentLength` is specified in bytes, so this configuration would limit requests, and therefore uploaded files, to 2 megabytes
`maxAllowedContentLength` is specified in bytes. For example:

- 2 MB = 2,000,000 bytes
- 100 MB = 100,000,000 bytes
- 4 GB = 4294967295 (maximum value allowed)

{% hint style="info" %}
**Are you hosting your site on Umbraco Cloud?**
## Hosting on Umbraco Cloud

Umbraco Cloud uses IIS for hosting. This means you need to add the setting in a `web.config` file for this to work on your Umbraco Cloud hosted sites.
The upload size limit is 500mb on Umbraco Cloud.
{% endhint %}
Umbraco Cloud uses IIS for hosting, so changes must be made in the `web.config` file as described above. The default upload limit on Umbraco Cloud is 500 MB.

# Using Kestrel
To customize this limit, adjust the `maxAllowedContentLength` value in your `web.config` file accordingly.

Runtime settings allow you to configure the `MaxRequestLength` and `MaxQueryStringLength` for kestrel. If you want to upload files larger than 28.6MB, then you have to configure these settings. If nothing is configured requests and query strings can only be the default size and smaller.
## Using Kestrel

An example of a configuration could look something like this:
Kestrel’s runtime settings allow you to configure `MaxRequestLength` and `MaxQueryStringLength`. If you want to upload files larger than 28.6MB, update these values in the `appsettings.json` file.

Example configuration:

```json
"Umbraco": {
Expand All @@ -48,8 +64,13 @@ An example of a configuration could look something like this:
}
```

`MaxRequestLength` is specified in kilobytes. This configuration will limit requests, and therefore uploaded files, to 2 megabytes, and a maximum query string length of 90 characters.
- `MaxRequestLength` is specified in kilobytes. For example:
- 2000 KB = 2 MB
- 100000 KB = 100 MB
- `MaxQueryStringLength` sets the maximum number of characters in the query string.

## External Server Configurations

## [Using Nginx (external)](https://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size)
### [Using Nginx (external)](https://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size)

## [Using apache (external)](https://httpd.apache.org/docs/2.2/mod/core.html#limitrequestbody)
### [Using apache (external)](https://httpd.apache.org/docs/2.2/mod/core.html#limitrequestbody)