![]() |
|
File repository - Printable Version +- Like Ra's Naughty Forum (https://www.likera.com/forum/mybb) +-- Forum: Technical section (https://www.likera.com/forum/mybb/Forum-Technical-section) +--- Forum: Site (https://www.likera.com/forum/mybb/Forum-Site) +--- Thread: File repository (/Thread-File-repository) |
File repository - Like Ra - 11 Mar 2026 I think we might need a separate file repository outside the standard MyBB mechanism (MyBB streams all attachments using a separate PHP process!!!!) Implementation-wise, the easiest way is: - create a directory tree on the webserver - upload big files (e.g. videos, audios, etc) in that directory structure - use either MyBB tags or auto-embedding to insert the direct links into posts The result: - no dependency on PHP/MyBB/authentication - maximum performance - minimum CPU/RAM load - best search engine indexing Looks easy and simple (and it is), but everything must be done by myself. For example: - someone uploads a file - I download it - I remove it from the post - I rename it and upload it into a specific directory - I edit the post and insert the direct link Any ideas how to automate it? RE: File repository - dhf7b8g - 11 Mar 2026 I think the best option for end users is to rewrite the mybb attachments system to do this uploading to the file server instead and make some minor edits to the post creator to handle these changes gracefully. This would make any PHP a one time "cost" per attachment and the user post flow would be virtually unchanged. Its easy to say "just rewrite it" but I really don't think there are any better options. Anything else would end up quite hacky compared to a one time migration of existing attachments and a fix directly at upload time. There are some questions though: How do you plan to lay out the directory? Segmented by user uploads? by thread? how will you programmatically handle conflicts? if there is no mybb auth how are private message attachments handled? (is the directory open, are filenames easy to guess etc?) RE: File repository - Like Ra - 11 Mar 2026 (Yesterday, 02:34 )dhf7b8g Wrote: I think the best option for end users is to rewrite the mybb attachments system tIdeally - absolutely. It can be done as a plugin, though I'm not sure. The idea behind the MyBB implementation of the attachment system is the granular access. In our forum, currently, everything is open to everybody, except the archive (it's hidden from the search engines). My simple idea was to move only big files, say, 15MB+ and videos to the separate file repository, and leave all usual images as they are an where they are. RE: File repository - krinlyc - 11 Mar 2026 You can simply use filesize https://www.php.net/manual/en/function.filesize.php and move bigger files somewhere else. no need for extra plugins. RE: File repository - Like Ra - 12 Mar 2026 (Yesterday, 22:13 )krinlyc Wrote: You can simply use filesize https://www.php.net/manual/en/function.filesize.php and move bigger files somewhere else. no need for extra plugins.It will break the access from the forum. RE: File repository - krinlyc - 12 Mar 2026 Why? You mount that other storage as a new directory to the directory structure of the forum. No breaks. On Unix you can use ln ( link ) for that. |