Separate Max File Size Options for "Internal Files" and "Overall Files"

AI-generated summary

Iceman proposes separating the “Max File Size” setting in Discourse into two distinct limits: one for general file uploads (e.g., drag-and-drop attachments in posts) and another for “internal files” such as avatars and profile customizations. This would allow administrators to restrict general uploads while still permitting high-quality profile images. sam acknowledges the request is rare but reasonable, noting that around 1 in 1000 customers have similar needs, and while open to adding such a setting, warns that the underlying code is complex. In a follow-up, Iceman shares a helpful workaround: Discourse 2.3.0.beta6 introduced a filter in the Top Uploads report that lets admins sort and filter attachments by extension and size — useful for identifying oversized images (often GIFs used for avatars) versus regular uploads (PNG, JPG, etc.). While this doesn’t fulfill the original feature request directly, it aids moderation by making it easier to clean up large files periodically, even if it risks breaking some posts. Iceman adds this as a reference for others and thanks the Discourse team for their ongoing work.

Hi Guys,

Is there the possibility of separating the “Max File Size” setting into two? Being one for “General Files” (which includes any type of file that the users may drag into the Reply Box) and “Internal Files”. What I mean by “Internal files” are the Avatars, the Profile Cards and all of the Customization Goodness that Discourse support.

This because even though I don’t really want to support uploading files (therefore a small file size as a limitation) I do want my users to upload good quality images for their profile customization.

Would this be too much of a loop? Does this kind of separation make sense for you guys?

BTW, to my understanding and searching there was a similar post but maybe I’m missing the option on my Admin Panel or we are talking about different features.

Thanks a lot for your time!

I think it is fair to say “I don’t want any uploads on my forum posts but do want to allow pretty avatars”. We have 1 in 1000 customers that has a similar problem, so your request is not unique, but it is fairly rare.

Not against adding some sort of setting here, but this is very fiddly code

3 Likes

Sorry for the bump. Just wanted to note the following both for future reference (in case that anyone is searching for the same) and to show some love for the constant work from the folks here at Discourse:

On Discourse 2.3.0.beta6 Release Notes a new feature was announced:

While this doesn’t divide the file sizes or restricts the uploads per sé as in the original request, it does help a lot identifying bigass images. Normally due to scaling the best way to fit an avatar within the limit size is to uploaded it in GIF. While the rest of normal “drag and drop” images just go in PNG, JPG or whatever the user pulls.

With this it is easier to allow some opening while cleaning once in a while by size, even though it may break some posts :stuck_out_tongue:

Just wanted to add this reference to the pot, thanks guys!

4 Likes