Repository: Rapptz/discord.py
Pull request: Change default file size limit
## Summary

Resolves #10083 

Might be worth documenting that this is provided on a "best effort at time of release" means somewhere, but for now, this just covers what discord says the limit is.

## Checklist

<!-- Put an x inside [ ] to check it, like so: [x] -->

- [ ] If code changes were made then they have been tested.
    - [ ] I have updated the documentation to reflect the changes.
- [X] This PR fixes an issue.
- [ ] This PR adds something new (e.g. new method or parameters).
- [ ] This PR is a breaking change (e.g. methods or parameters removed/renamed)
- [ ] This PR is **not** a code change (e.g. documentation, README, ...)


Problem statement:
Guild file size limit is incorrect
### Summary

When getting the guild.filesize_limit attribute with your discord bot, the guild filesize limit is wrong.

### Reproduction Steps

Create your discord bot
Get the channel you want to upload to using it's id
Get the filesize limit of the guild

### Minimal Reproducible Code

```python
# Get the channel
channel = bot.get_channel(channel_id)

# Get the limit
limit = channel.guild.filesize_limit

# Upload a large file and check for limit

if os.path.getsize(file_path) > limit:
    return

discord_file = discord.File(file, filename=os.path.basename(file_path))
await channel.send(file=discord_file)
```

### Expected Results

The code should return early since the file is too large for the server

### Actual Results

The function doesn't return early and channel.send raises HTTP error 413: Payload too large

### Intents

intents = discord.intents.default(); intents.members = True

### System Information

- Python v3.13.0-final
- discord.py v2.4.0-final
- aiohttp v3.10.10
- system info: Windows 10 10.0.19045

### Checklist

- [x] I have searched the open issues for duplicates.
- [x] I have shown the entire traceback, if possible.
- [x] I have removed my token from display, if visible.

### Additional Context

_No response_

Hints from issue discussion:

Commit message: Change default file size limit

Patch to review:
diff --git a/discord/utils.py b/discord/utils.py
index bd327b5a8bb1..c563d7531695 100644
--- a/discord/utils.py
+++ b/discord/utils.py
@@ -108,7 +108,7 @@
 )
 
 DISCORD_EPOCH = 1420070400000
-DEFAULT_FILE_SIZE_LIMIT_BYTES = 26214400
+DEFAULT_FILE_SIZE_LIMIT_BYTES = 10000000
 
 
 class _MissingSentinel:


Code review comments:
diff_hunk: @@ -108,7 +108,7 @@
 )
 
 DISCORD_EPOCH = 1420070400000
-DEFAULT_FILE_SIZE_LIMIT_BYTES = 26214400
+DEFAULT_FILE_SIZE_LIMIT_BYTES = 10000000
path: discord/utils.py
text: @user1:
```suggestion
DEFAULT_FILE_SIZE_LIMIT_BYTES = 10485760
```

@author:
huh. I just went with the amount as advertised (which uses `MB`), guess it's not really a problem for them to under-promise slightly.

@user1:
![image](https://github.com/user-attachments/assets/e4b42617-35ab-4528-96eb-78f177809cb6)