How to Troubleshoot IIS File Upload 413 Errors? Align Request Limits First

How to Troubleshoot IIS File Upload 413 Errors? Align Request Limits First

Microsoft documents a default IIS maxAllowedContentLength of 30,000,000 bytes in request filtering (IIS requestLimits reference). That limit is only one possible gate. For an IIS file upload 413, first use IIS and application logs to find the rejecting layer, then align IIS, ASP.NET Core request-body, and form limits with the actual upload requirement. Do not raise every limit by default.

This guide is for you if:

IIS file upload 413: identify the rejecting layer

A browser error alone is not enough to locate the limit. The browser may display 413 even when IIS logs a different status, and an application or another component in the request path may also reject a request. Start with evidence from the server.

In IIS Manager, open the site’s Logging settings and confirm where its log files are stored. The IIS logging guide explains how to configure and review IIS logs. Check the recorded status and substatus for the failed request. Microsoft’s 404.13 troubleshooting guidance identifies 404.13 as an IIS response associated with request content exceeding the configured limit.

Then compare that evidence with the application log:

This distinction matters because changing an application setting cannot make IIS accept a request it has already rejected. Likewise, raising an IIS limit will not resolve a lower limit enforced by ASP.NET Core.

IIS request filtering: inspect the request content limit

IIS request filtering uses requestLimits to control request characteristics, including the maximum content length. Microsoft documents maxAllowedContentLength in the requestLimits reference, including its default value of 30,000,000 bytes. That is a documented default, not a recommended upload size for every business application.

Check both the site configuration and any applicable server-level configuration. A value in a site’s web.config may not be the only setting that affects the request. In IIS Manager, open the site, select Request Filtering, and review its settings. You can also inspect the effective configuration with PowerShell:

Get-WebConfigurationProperty `
  -PSPath 'IIS:\' `
  -Location 'YourSiteName' `
  -Filter 'system.webServer/security/requestFiltering/requestLimits' `
  -Name 'maxAllowedContentLength'

Replace YourSiteName with the IIS site name. Before editing, record the current effective value and identify whether it comes from the site or a parent configuration. The Microsoft guide to configuring IIS request filtering describes the feature and where its settings apply.

If the site needs a different limit, put the intended value in the correct configuration scope and keep it tied to the business requirement. For example, an upload workflow for small documents should not inherit a large-file limit merely because another workflow needs one.

A site-level web.config entry takes this form:

<configuration>
  <system.webServer>
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="APPROVED_LIMIT_IN_BYTES" />
      </requestFiltering>
    </security>
  </system.webServer>
</configuration>

Replace the placeholder with the approved byte limit. Do not deploy the placeholder as-is. If the section is locked or the site inherits a conflicting setting, resolve that configuration issue rather than repeatedly editing the same file.

ASP.NET Core request bodies: check the IIS-hosted server limit

IIS request filtering and ASP.NET Core’s request-body handling are separate controls. Microsoft’s IISServerOptions reference documents MaxRequestBodySize for the IIS server integration. Its documented default is 30,000,000 bytes; check the documentation for the framework version your application actually uses before relying on a default.

Inspect the application’s startup configuration and any endpoint-specific attributes or middleware that may set a different limit. For an app using the IIS server integration, configuration may look like this:

using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Server.IIS;

builder.Services.Configure<IISServerOptions>(options =>
{
    options.MaxRequestBodySize = approvedLimitInBytes;
});

approvedLimitInBytes is a placeholder for a value you determine from the application’s requirements. Confirm the setting is used by the hosting model and application version you deploy. Microsoft’s ASP.NET Core Module documentation describes how ASP.NET Core applications run behind IIS and why the hosting arrangement matters.

Avoid assuming that an IIS setting in web.config automatically changes IISServerOptions. Treat the IIS filter and ASP.NET Core server limit as separate checkpoints. If you increase one and the other remains lower, the lower effective limit can still reject the request.

Multipart forms: separate form parsing from request size

A multipart upload submitted through form model binding can encounter a form-specific limit in addition to the general request-body limit. These settings are not synonyms. The ASP.NET Core FormOptions reference documents MultipartBodyLengthLimit and its default of 134,217,728 bytes. Confirm version-specific behavior in the documentation for your application.

First identify how the endpoint processes uploads:

Microsoft’s ASP.NET Core file-upload guidance covers upload approaches and security considerations. Adjust a multipart limit only when the upload actually uses that parsing path. Increasing it does not necessarily change the overall request-body cap, and changing the body cap does not necessarily change form parsing behavior.

Keep each limit close to the largest legitimate request for that specific layer. Broad, unexplained increases make resource use harder to control and can expose the application to oversized requests.

Other failure causes: verify storage and application evidence

If the relevant limits already allow the intended request, stop changing size settings and investigate the next observable failure. A failed upload does not prove that a request-size limit is responsible.

Check whether the request reached the application and whether the application log records a parsing, validation, or file-write exception. Review the configured temporary-file and destination paths, the identity under which the application runs, available disk space, and the result of the write operation. A permissions problem or a disconnected client can interrupt an upload, but neither should be labelled a 413 cause without supporting evidence.

Do not treat ASPNETCORE_TEMP as a universal fix. It is only relevant when the application’s upload path uses temporary storage affected by that setting. Establish the actual exception and write location first, then change the setting or permissions that correspond to the observed failure.

For IIS logs, correlate the request time, URL, status, and substatus with the application log entry. If a request is absent from the application log, that absence can help narrow the investigation, but it is not proof by itself: confirm logging is enabled and that you are checking the correct site and application instance.

Change and validation milestones

Make the smallest controlled change that addresses the layer identified by the logs. Use this sequence:

Before changing configuration

During the change

For a site-scoped IIS change, PowerShell can set the value you have approved:

Set-WebConfigurationProperty `
  -PSPath 'IIS:\' `
  -Location 'YourSiteName' `
  -Filter 'system.webServer/security/requestFiltering/requestLimits' `
  -Name 'maxAllowedContentLength' `
  -Value $approvedLimitBytes

Set $approvedLimitBytes to the approved value before running the command. Do not copy an arbitrary number from an unrelated site or workflow.

After the change

This gives you a clear rollback path: restore the saved configuration, confirm the previous behavior, and continue diagnosis from the logged evidence. Do not validate only from the browser; compare the IIS and application records for the same request.

Deployment environment: confirm the Windows Server fit

If you are preparing a new IIS business site, verify the target Windows Server version, language, and access method against the application’s dependencies and operating procedures. AMDSSH lists Windows Server options including 2019, 2022, and 2025, with English, Traditional Chinese, and Simplified Chinese language choices; Windows access is by RDP. Check the current order options when selecting an environment, since available options should be confirmed on the product page.

This helps you align the server environment with the application and the administrators who will maintain it. It does not establish an IIS upload limit or guarantee upload performance. Set the upload boundary in the application and IIS configuration, then validate it using your own workflow and logs. If you are still comparing deployment needs, AMDSSH’s server scenarios can help you assess the broader environment before committing.

FAQ

Which IIS setting should I check when an upload fails with 413?

Start with the IIS requestFiltering setting named maxAllowedContentLength, then verify the IIS log status and substatus. IIS may log an oversized request as 404.13 rather than displaying 413 in the browser. If IIS did not reject the request, check the ASP.NET Core server and form limits before changing configuration.

Does IIS 404.13 mean the same thing as a 413 response?

They can describe the same underlying issue—request content exceeding a configured limit—but they are not interchangeable status codes. IIS request filtering can log 404 with substatus 13, while a browser or another component may show 413. Use the server logs and application logs to identify where the request stopped.

Why does ASP.NET Core still reject uploads after I change web.config?

web.config can change an IIS request filtering limit, but it does not necessarily change the ASP.NET Core server’s request-body limit or the limit applied by multipart form parsing. Confirm which upload implementation handles the request, inspect the relevant settings, and raise only the limit that is actually rejecting the request.

How do I set ASP.NET Core and IIS upload limits together?

First choose the largest legitimate request your application must accept. Configure IIS request filtering to permit it, then check the ASP.NET Core IIS server limit and, when using form model binding, the multipart form limit. Apply the smallest required changes and test the full upload path; these settings control different layers and do not automatically synchronize.

Choosing the server after fixing the limit

If you already run a stable IIS site and only need to correct one upload boundary, changing servers will not replace the configuration work in this guide. But if your current shared environment adds contention, restricts the Windows environment you can configure, or leaves resource and storage boundaries unclear, a dedicated AMD physical server may be a better fit for a business site that needs sustained, administrator-controlled operation.

AMDSSH rents dedicated AMD physical servers and offers the Windows Server versions and language options described above. If you are planning a new IIS deployment, compare those options with your application dependencies and remote administration requirements, then validate upload limits in the deployed environment. The server choice can give you a dedicated machine; the actual request ceiling still needs to be set and tested at each IIS and ASP.NET Core layer.

Frequently asked questions

Which IIS setting should I check when an upload fails with 413?

Start with the IIS requestFiltering setting named maxAllowedContentLength, then verify the IIS log status and substatus. IIS may report an oversized request as 404.13 rather than displaying 413 in the browser. If IIS did not reject the request, check the ASP.NET Core server and form limits before changing configuration.

Does IIS 404.13 mean the same thing as a 413 response?

They can describe the same underlying issue—request content exceeding a configured limit—but they are not interchangeable status codes. IIS request filtering can log 404 with substatus 13, while a browser or another component may show 413. Use the server logs and application logs to identify where the request stopped.

Why does ASP.NET Core still reject uploads after I change web.config?

web.config can change an IIS request filtering limit, but it does not necessarily change the ASP.NET Core server's request-body limit or the limit applied by multipart form parsing. Confirm which upload implementation handles the request, inspect the relevant settings, and raise only the limit that is actually rejecting the request.

How do I set ASP.NET Core and IIS upload limits together?

First choose the largest legitimate request your application must accept. Configure IIS request filtering to permit it, then check the ASP.NET Core IIS server limit and, when using form model binding, the multipart form limit. Apply the smallest required changes and test the full upload path; these settings control different layers and do not automatically synchronize.

Further reading

EPYC 7543P dedicated serverFrom $450.2/month

Choose a model, then configure the server

The monthly total depends on the selected model and options. Full pricing details are listed on the configuration page. Connection credentials are available in the console after delivery.