Changing Max Attachment Size


#1

Here is what you need to do to allow more than 10mb for attachments upload.

  1. Connect to your server via SSH

  2. cd /var/discourse/

  3. nano containers/app.yml

  4. Scroll down where it says db_default_text_search_config under params

Add upload_size: 20m below db_default_text_search_config

params:
  db_default_text_search_config: "pg_catalog.english"

  # replace 20m with desired value
  upload_size: 20m

After making changes press Ctrl+O (to write) and Ctrl+X (to exit).

From /var/discourse run:

./launcher rebuild app

Once rebuild is complete, navigate to forum.example.com/admin/site_settings/category/files and change the max attachment size kb to 20480 (20mb) or your desired number. At this point everything should work perfectly, you can go on and test your upload file size.

Cheers.


Can't Increase the Max File Size
Arbitrarily large file uploads
Why is Max image size limited to 100MB?
Can't Increase the Max File Size
Rebuild app failed due to issue with mini-racer
Upload attachment fails
With Uploads -- That page doesn’t exist or is private
Rebuild app fails due to allowed attachment size change
Rebuild of Discourse fails due to spaces in YAML file
(Diogocsc) #32

I’ve followed these instructions but when I send an email to my category with an attachment with around 9mb, I get:

Message too large

Your message couldn’t be delivered to [myemail@email.com] because it exceeds the size limit. Try reducing the message size and resending.
The response from the remote server was:

552 5.3.4 Message size exceeds fixed limit

P.S. [myemail@email.com] is a “category” email


(Sam Saffron) #33

This is completely unrelated to Discourse, that error is coming from your mail server. The mail server is not even handing the mail over to Discourse it is rejecting it.


(Diogocsc) #34

Thanks for pointing this out Sam. From your answer I went on and took another look and managed to someway fix this issue.
I started by questioning if this was on sender or receiver side. Sender was gmail and the limit was 25 mb so it couldn’t be there. Receiver was mail_receiver.
Below a link where I also share what I’ve done in case someone faces a similar issue.