"Sorry, this file is too large" but no

AI-generated summary

Users are encountering an upload error in Discourse stating “Sorry, this file is too large (the maximum size allowed is 4096 KB)” even when they’ve increased max_image_size_kb and max_attachment_size_kb to 20,000 KB. The issue often stems from misconfigured reverse proxies, specifically the client_max_body_size setting, as noted by d.s.e and itsbhanusharma. codinghorror suggests this is likely a configuration issue specific to the user’s instance, since 4MB is Discourse’s default limit. Several users, including meglio and SS03, report the error message is misleading — it references Discourse settings rather than the actual reverse proxy limit — and request clearer, actionable messaging, such as suggesting cloud uploads for large files. The consensus is that the error should reflect the true bottleneck (e.g., reverse proxy) and offer helpful next steps to users.

For a picture I want to upload on last version of Discourse, max_image_size_kb and max_attachment_size_kb both at 4096, event if I set 20000 Kb, my picture (jpg) is 1.2Mo and I have this error:


Sorry, this file is too large (the maximum size allowed is 4096 KB).

Unless you can reproduce it here, this is a configuration problem with your instance. 4MB is the default upload limit in Discourse.

The most common cause of this issue is a reverse proxy that is not configured properly.

I had exactly the same problem, but setting client_max_body_size in my reverse proxy fixed this.

But the error message displayed is misleading, because it tells the user the value set in max_image_size_kb and not the setting that is causing the problem. Maybe this could be changed to a better wording.

Same happens to me, the error message confuses further instaed of trying to help. Please improve the error message, make it actionable.

Sorry, that file is too big (maximum size is 50 MB). Why not upload your large file to a cloud sharing service, then paste the link?

.. and I’m uploading a file between 10 and 20 mb.

@meglio , Recently we have also encountered same issue, where you able to find solution for it ?