Skip to content

update the upload config #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 16, 2025
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
78 changes: 28 additions & 50 deletions usync/02.complete/05.reference/08.upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,63 +2,41 @@
title: File Upload Size
---

There are several features within uSync.Complete where you can upload data, either directly or between servers. When you do this, you might be uploading large amounts of data or media files and you can encounter a [`404.13` error](https://learn.microsoft.com/en-us/troubleshoot/developer/webapps/iis/health-diagnostic-performance/http-404-13-website) which is 'request to large'.
There are several features within uSync.Complete where you can upload data, either directly or between servers. When you do this, you might be uploading large amounts of data or media files and you can encounter a [`404.13` error](https://learn.microsoft.com/en-us/troubleshoot/developer/webapps/iis/health-diagnostic-performance/http-404-13-website) which is 'request too large'.

To bypass this error, you can change the allowed upload size for your application via the web.config.

However, if you don't want to make a global change of this value for all requests on your site, you can change it for specifically for uSync.Publisher and uSync.Exporter requests by using the configuration(s) below:
To do this you need to add the following to the `<system.webserver>` section of your web.config file.

## uSync.Publisher

All server to server uSync.Publisher requests will go via a `umbraco/uSyncReceive` end point, so the following config will change the allowed upload size for all uSync.Publisher requests.

```xml title="web.config"
<location path="umbraco/uSyncReceive">
<!-- Up the file upload limit to 500mb, this is for moving media around -->
<system.web>
<httpRuntime maxRequestLength="512000"/>
</system.web>
<system.webServer>
<security>
<!-- Restrict API access by IP -
you can here restrict so only the servers
can talk to each other -->
<!--
<ipSecurity allowUnlisted="false">
<add allowed="true" ipAddress="192.168.0.1" subnetMask="255.255.255.0" />
<add allowed="true" ipAddress="127.0.0.1" subnetMask="255.255.255.0" />
</ipSecurity>
-->
<requestFiltering>
<requestLimits maxAllowedContentLength="524288000" />
</requestFiltering>
</security>
</system.webServer>
</location>
```xml title="Upload request size configuration"
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2147483648" />
</requestFiltering>
</security>
```

The config above will set the upload limit for the `Umbraco/uSyncReceive' root to 500mb, allowing for a large number of media files to be synced as part of a single publish.
Depending on other bits of configuration, your web.config might looks like this:

It will also put a placeholder in, should you wish to restrict the publisher root by IP address for security reasons.

## uSync.Exporter

All uSync.exporter requests go via `umbraco/backoffice/usync/uSyncNuexporterApi`, so the following config will set the upload limit for requests to that path.
:::warning
This is a sample web.config. Do not overwrite your own web.config, add only the required section.
:::

```xml title="web.config"
<location path="umbraco/backoffice/uSync/uSyncNuExporterApi">
<!-- Up the file upload limit to 500mb, this is for moving media around -->
<system.web>
<httpRuntime maxRequestLength="512000"/>
</system.web>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="524288000" />
</requestFiltering>
</security>
</system.webServer>
</location>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\uSyncSiteName.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="104857600" />
</requestFiltering>
</security>
</system.webServer>
</location>
</configuration>
```

This will up the upload limit for the `umbraco/backoffice/uSync/uSyncNuExporterApi' root to 500mb, allowing you to import larger 'syncpack' files directly within the uSync.Exporter dashboard.