How to attach a PDF file?

AI-generated summary

Users are seeking help to attach PDF files on Discourse, which by default restricts uploads to image formats. Mpitily reports the issue and merefield guides them to adjust file settings, noting that PDF uploads may be restricted to staff. After enabling PDF uploads, Mpitily encounters a download error at 50%, which merefield suggests may relate to large file sizes requiring nginx config adjustments. Mpitily resolves the issue by compressing the file. merefield also suggests increasing the upload size limit via settings. sok777 asks if PDF uploads can be enabled for all users but only in private messages; pfaffman clarifies that PMs are treated as topics, so enabling PDFs applies site-wide. sok777 then asks about document upload limits by trust level, but no specific setting exists. VVoPham later asks where to find the file settings; pfaffman advises searching site settings for “upload” or “extension”. VVoPham successfully enables PDF uploads and thanks the community. pfaffman asks them to mark the answer, but VVoPham can’t since it’s not their topic; pfaffman clarifies this, and VVoPham suggests Mpitily mark the solution if not already done.

Hello

We are using Discourse as a tool to exchange and share experiences.
I was going to publish PDF content but the file attachment only allows jpg, jpeg, png, gif, heic, heif, webp extensions.

Could someone give me a way to attach the PDF file in the platform please ?

Thanks

It’s in your Files settings:

In this example, only staff are allowed to upload pdf files.

Thank you for your help.

I have changed the settings and now the PDF can be attached.
However, when I reach 50% of the download, it stops and gives this message:
“Sorry, there was an error sending the file. Please try again.”
I tried more than 5 times but it gives this again.

What would be the problem ? and how to fix it please ?

You might need to update your nginx config too if the files are very large:

Yes, after compressing the file, it worked !

Thanks a lot for your help !

You can also try in first instance to increase this value:

image

@merefield Is there any way to enable PDF for all users but only for private messaging?

No. At least not easily.

PMs are just topics. If you enable pdf uploads it’ll be for all topics.

Thanks @pfaffman ! How about uploading docs (not images) limitations by TL?

Hi Robert! One of my community’s users is trying to attach a PDF in a comment (I see the error “Attachment Pena Network.pdf is missing”), and it’s not working. Where can I find the files settings in Discourse, so I can enable PDF uploads? I’m having a hard time locating it.

There is a separate setting for staff, but not tl.

@VVoPham is you search the site settings for upload and maybe extension you should find it. You could also search jpg to find the settings that have that as a value.

Thanks! Found it, and we were able to upload PDFs successfully! :grin:

Great! Can you click that checkbox indicating that my post answered your question?

Hi Jay, I’d be happy to. Where is that checkbox? I might be missing it somewhere…

Oh. Sorry. It’s not your topic, so you don’t have that option. Never mind. :person_shrugging:

Oh no, sorry! Hopefully, you can follow up with Mpitily, so they can do this, if they haven’t already! :slightly_smiling_face: