Skip to content

Commit 2c09c19

Browse files
authored
Per-Attachment File Upload Behavior for Apps (#7451)
* Document attachment_size_limit * changelog * attachment_size_limit is MAX(default_limit, user_limit, guild_limit)
1 parent f9f932c commit 2c09c19

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: "Per-Attachment File Upload Behavior for Apps"
3+
date: "2025-04-03"
4+
breaking: false
5+
topics:
6+
- "HTTP API"
7+
- "Interactions"
8+
---
9+
10+
Starting today, file upload limits for apps are checked per-attachment rather than per-message. This change makes the app attachment behavior the same as when a user uploads multiple attachments on a single message.
11+
12+
- File size limits now apply to each individual attachment
13+
- Previously, limits were applied to the combined size of all attachments in a message
14+
- This aligns app attachment handling with user attachment behavior
15+
16+
The interaction payload will also include a new `attachment_size_limit` key that specifies the maximum allowed attachment size. This limit may be higher than the default attachment size limit, depending on the guild's boost status or the invoking user's Nitro status.
17+
18+
For more information, check out [our documentation on file uploads](#DOCS_REFERENCE/uploading-files).

docs/interactions/receiving-and-responding.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ For [Message Components](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/) it includes ide
3737
| entitlements | array of [entitlement](#DOCS_RESOURCES_ENTITLEMENT/entitlement-object) objects | For [monetized apps](#DOCS_MONETIZATION_OVERVIEW), any entitlements for the invoking user, representing access to premium [SKUs](#DOCS_RESOURCES_SKU) |
3838
| authorizing_integration_owners | dictionary with keys of [application integration types](#DOCS_RESOURCES_APPLICATION/application-object-application-integration-types) | Mapping of installation contexts that the interaction was authorized for to related user or guild IDs. See [Authorizing Integration Owners Object](#DOCS_INTERACTIONS_RECEIVING_AND_RESPONDING/interaction-object-authorizing-integration-owners-object) for details |
3939
| context? | [interaction context type](#DOCS_INTERACTIONS_RECEIVING_AND_RESPONDING/interaction-object-interaction-context-types) | Context where the interaction was triggered from |
40+
| attachment_size_limit | integer | Attachment size limit in bytes |
4041

4142
\* This is always present on application command, message component, and modal submit interaction types. It is optional for future-proofing against new interaction types
4243

docs/reference.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ https://cdn.discordapp.com/attachments/1012345678900020080/1234567891233211234/m
397397
## Uploading Files
398398

399399
> info
400-
> A file upload size limit applies to *all* files in a request (rather than each individual file). While the limit depends on the [**Boost Tier**](https://support.discord.com/hc/en-us/articles/360028038352-Server-Boosting-FAQ-#h_419c3bd5-addd-4989-b7cf-c7957ef92583) of a guild, it is `10 MiB` by default.
400+
> The file upload size limit applies to each file in a request. The default limit is `10 MiB` for all users, but may be higher for users depending on their [Nitro](https://support.discord.com/hc/en-us/articles/115000435108-What-are-Nitro-Nitro-Basic) status or by the server's [Boost Tier](https://support.discord.com/hc/en-us/articles/360028038352-Server-Boosting-FAQ-#h_419c3bd5-addd-4989-b7cf-c7957ef92583). The `attachment_size_limit` value provided [when working with interactions](#DOCS_INTERACTIONS_RECEIVING_AND_RESPONDING/interaction-object-interaction-structure) is calculated as the maximum of these values.
401401
402402
Some endpoints support file attachments, indicated by the `files[n]` parameter. To add file(s), the standard `application/json` body must be replaced by a `multipart/form-data` body. The JSON message body can optionally be provided using the `payload_json` parameter.
403403

0 commit comments

Comments
 (0)