Alongside its awesome image handling, Discourse now supports attachments.
You can already try it out on try where you can upload
If you want to enable attachments on your instance, you have to update the “
authorized_extensions” setting. It’s pipe-separated list of all the extensions you want to allow.
For example, here’s the setting used on try:
Sidenote: the check is only done on the extension of the file. Checking the actual content/encoding/mime-type of the uploaded file will be added later.
There’s 2 other settings you can customize:
max_attachment_size_kb: the maximum allowed size for attachments, independently of images (defaults to 1024 kB)
newuser_max_attachments: how many attachments a new user can add to a post (defaults to 0)
WARNING: if you change the
max_attachment_size_kb, make sure you also update your web server’s request limit.
On the client-side, attachments work pretty much the same as images. You can use the upload button in the composer toolbar or drag & drop multiples files in the composer to attach them to your post.
The result will be inlined in your post like so: discourse.txt (18 Bytes)
Discourse will automatically add the size of the attachment and track all the clicks.