Discord API · error code

Discord error 50045: File uploaded exceeds the maximum size

Permanent - do not retryHTTP 400Maximum reached (30xxx)

Last verified against Discord Developer Docs - Opcodes and status codes

What Discord returns
File uploaded exceeds the maximum size

What error 50045 means

An attachment in your message is larger than the upload limit that applies to the destination. For bots the baseline is 10 MiB per upload; servers boosted to higher tiers raise it for that server, and Nitro raises it for users but not for bots. Unlike 40005, which is the transport-level "request too large", 50045 is Discord's own check after it has parsed the multipart body and looked at each file.

This also covers image fields that are not message attachments. Custom emoji images have a much smaller cap (256 KB), and avatars, banners, stickers and role icons each have their own. Sending a 2 MB PNG as an emoji yields 50045 even though it is well under the attachment limit.

What it looks like

{
  "message": "File uploaded exceeds the maximum size",
  "code": 50045
}

Why it happens

  • Attachment larger than 10 MiB in a non-boosted server
  • Emoji, sticker, avatar or role icon image over its specific cap
  • Relying on Nitro limits that apply to the developer's user account, not the bot
  • Transcoded media (GIF, video) that grew during processing

How to fix Discord error 50045

  1. 1Check file size before sending; compress or downscale images, re-encode video, or host externally and link
  2. 2Read premium_tier from GET /guilds/{id} to determine the applicable limit for that server
  3. 3For emoji and icons, resize to the documented dimensions and keep under 256 KB
  4. 4Split large exports across multiple messages or attach a link to cloud storage

How to stop it recurring

Implement a size gate with per-destination limits (message attachment vs emoji vs avatar) in your upload helper, and reject or shrink before calling Discord. Default to the non-boosted limit unless you have confirmed the server's tier.

Every media field has its own ceiling, and the attachment limit is just the largest of them. The full table, message attachments, emoji, stickers, avatars, is on the Discord limits page; a file that is small enough but undecodable fails with 50046 instead, so size and validity checks belong together in the upload path.

Official reference: Discord Developer Docs - Opcodes and status codes. See all Discord error codes or the Discord limits and quotas.

Related codes

Error 50045 - quick answers

What does Discord error 50045 mean?

An attachment in your message is larger than the upload limit that applies to the destination. For bots the baseline is 10 MiB per upload; servers boosted to higher tiers raise it for that server, and Nitro raises it for users but not for bots. Unlike 40005 , which is the transport-level "request too large", 50045 is Discord's own check after it has parsed the multipart body and looked at each file.

How do I fix Discord error 50045?

1. Check file size before sending; compress or downscale images, re-encode video, or host externally and link 2. Read premium_tier from GET /guilds/{id} to determine the applicable limit for that server 3. For emoji and icons, resize to the documented dimensions and keep under 256 KB 4. Split large exports across multiple messages or attach a link to cloud storage

Should I retry after error 50045?

No. Retrying the same request produces the same error; the condition has to be fixed first. Treat it as a permanent failure for that message and surface it, rather than looping.

Stop debugging Discord by hand

Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.