The discussion revolves around the best approach to store and share files with users on a Discourse site. The original poster, foros, attempted to upload files to /var/discourse/, but Stephen recommended attaching files to posts instead, as Discourse doesn’t expose the webroot.
Digitalgerry sought advice on minimizing storage on their DigitalOcean server and was considering uploading documents to their WordPress site and linking to them from Discourse. Merefield suggested exploring S3 uploads, but Digitalgerry clarified that they already have server space for their WordPress site.
Stephen offered insights on the trade-offs between attaching files directly to Discourse posts and linking to external hosts like WordPress. He noted that attached files in Discourse are deleted when the post is deleted, but can be protected from unauthorized access. In contrast, WordPress can manage attachments independently of posts, but may not offer the same level of access control. Ultimately, the best approach depends on the user’s workflow and needs.
I want users to download files I can store in my server. I created a folder at /var/discourse/, where I uploaded a .doc file so that users can download it just by clicking on the link, example https://www.example.com/forms/theformpath.doc
Where is my server I can put files to be accesible using my discourse site if this is not working in /var/discourse?
Attach them to posts. From there you can either link to the posts which contain the files or the attachments themselves. Discourse isn’t document management and doesn’t expose the webroot.
Stephen - I am creating a Resource Category and within that topics and posts. To maintain minimimal storage on my osted server (which isn’t mine it’s digitalocean) would it be best to upload the document in the post OR add the link from where the document is stord (for example in my wordpress site?). I;d welcome your thoughts
I wasn’t in particular wanting S3 I’m working on the best way to minimise my DigitialOcean space (I have server space for my own WP site, so I can have documents there and will be featuring some on my site also, so would it be best to take the URL from where hosted and add to the Discourse post, or attach directly?
If a Discourse post which has included an attachment is deleted, that attachment will also eventually be lost. On the other hand attachments to Discourse posts can be protected and restricted from download by users who don’t have access to the original topic/post.
WordPress can manage attachments too, but doesn’t require they be listed in posts. Out-of-the-box it can’t protect files in the same way, if someone can get the path they can usually access the asset.