"Sorry, this file is too large" but no

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:

image


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

1 个赞

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

4 个赞

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

6 个赞

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.

2 个赞

同样的情况也发生在我身上,错误消息只会让人更加困惑,而不是提供帮助。请改进错误消息,使其更具可操作性。

对不起,该文件太大了(最大尺寸为 50 MB)。为什么不将大文件上传到云共享服务,然后粘贴链接?

……而我上传的文件在 10 到 20 MB 之间。

3 个赞

@meglio,我们最近也遇到了同样的问题,您是否找到了解决方案?