# Microsoft.AspNetCore.Server.Kestrel: BadHttpRequestException: Request body too large (max 30,000,000 bytes)

**Code:** `Request body too large` · **Category:** .NET · **Seen on:** .NET, ASP.NET Core

The upload exceeded Kestrel's default 30 MB request body limit.

## Meaning

`MaxRequestBodySize` defaults to about 28.6 MB. Form and multipart limits are separate (`FormOptions.MultipartBodyLengthLimit` is 128 MB). IIS has its own `maxAllowedContentLength`.

## Common causes

- File larger than the Kestrel limit
- IIS request filtering limit
- Form options limit lower
- Reverse proxy limit

## Quick fix

1. Raise limits for the endpoint (`[RequestSizeLimit]`, `DisableRequestSizeLimit`)
2. Update `web.config` for IIS
3. Stream large uploads

## Detailed fix by platform

### C#

1. `[RequestSizeLimit(200_000_000)]` or `builder.WebHost.ConfigureKestrel(o => o.Limits.MaxRequestBodySize = 200_000_000);`

## How to diagnose

1. **Layer** — Kestrel, IIS or proxy?
2. **Limit** — Which setting?
3. **Size** — File size?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/dotnet/aspnet-request-body-too-large-kestrel)
