The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Storing attachments in Amazon Cloud (S3)
Hello!
I'm trying to figure out a way to store forum (and all other) attachments in the Amazon Cloud (S3). Has anyone tried to do something like this or has any pointers? I think a possible workflow could be to write a plugin that runs after the file / attachment has been uploaded, gets its file path and then pushes the files to the cloud. This last bit I already know how to do, I'm just having difficulty with figuring out: - what hook to use for the plugin - what variable(s) store the attachment filepath Thank you all in advance for any help you can provide! |
#2
|
||||
|
||||
The attachments are currently stored locally on the server. There's no way in vBulletin to specify upload paths that aren't local. Besides, Amazon S3 is a different file storage type, so upload to it is different than what vBulletin has.
I wouldn't want to store attachments in the database. Not sure what else to try... |
#3
|
|||
|
|||
Yeah, I just deleted my post because I wasn't paying attention to the "s3" part. Sorry.
You might be able to use the attachment_complete hook to know when the upload has completed, then build your script to run then. The file path is built with the assigned directory, userid and filedataid. So, if you're assigned directory is: uploads and the userid is 21 and the filedataid is 897 the full path would be /uploads/2/1/897.attach The actual filename is stored in the database. |
#4
|
|||
|
|||
For anyone reading this thread in the future see https://vborg.vbsupport.ru/showthread.php?p=2429574
--------------- Added [DATE]1371827276[/DATE] at [TIME]1371827276[/TIME] --------------- My idea related to this is to somehow make use of the attachments.php file provided here. Then set up a cron job to run every night using http://s3tools.org/s3cmd-sync to transfer all newly uploaded attachments to my Amazon s3 account and another cron job to delete all image attachments older than, say, 2 weeks. That way I will only have to store 2 weeks' worth of attachments on my server. |
#5
|
||||
|
||||
Any good solutions for this? That mod you link to is no longer available.
|
#6
|
||||
|
||||
I ended up using S3FS (https://code.google.com/p/s3fs/) to mount an S3 bucket to a local folder, and everything worked great!
|
#7
|
||||
|
||||
Quote:
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|