Wrong maximum size when uploading files

AI-generated summary

The discussion revolves around the “Wrong maximum size when uploading files” issue. martinduparc reported that despite setting the maximum file size to 200MB, the error message displayed when uploading a file above this size shows a maximum size of 10,240KB (10MB). jomaxro suggested a possible relation to a previous commit fixing an error message. codinghorror inquired about restarting Discourse after changing the setting, to which martinduparc replied that a full app rebuild was performed. codinghorror asked if the value was hardcoded in text. martinduparc checked the localization file and found no evidence of hardcoding. However, zogstrip revealed that the value is indeed hardcoded and apologized for the mistake. A fix was pushed by zogstrip to resolve the issue.

The current maximum size I have set up is 200MB. Uploading a file that is less than 200MB works fine but anything above fails, as expected. The issue I have is that the user is then presented with the following message:

Sorry, the file you are trying to upload is too big (maximum size is 10240kb)

Nginx is properly configured at 200m and the max image size kb and max attachment size kb are both set to 200000

「いいね!」 2

Could the issue be related to this commit which was fixing the error message?
https://github.com/discourse/discourse/pull/3425

Did you restart Discourse after changing that setting? It might be required.

「いいね!」 1

I did a full app rebuild after changing the size. Again, file upload works properly, it’s just the error message that still display 10MB. I have entered the container and the internal nginx cont file is right at 200m

Hmm sure @techapj can you follow up and see? Do we hard code this value in text?

「いいね!」 1

It doesn’t look like it is hardcoded, at least not in the localization file.

We do actually. My bad. Will fix.

(cc @techAPJ)

「いいね!」 3

Thanks @martinduparc for reporting this issue. Fix pushed :green_apple:

https://github.com/discourse/discourse/commit/a5d8dfb07e5362f688344f576160066fd0bfaceb

「いいね!」 4

This topic was automatically closed after 2 hours. New replies are no longer allowed.