Storing Attachments in Amazon AWS S3  


Tim Rodman
Posts: 9
Customer
(@tim40)
Member
Joined: 2 years ago

I'm using the wpForo Advanced Attachments plugin. I like it, but all of the attachments get stored in the MySQL database which is starting to bog things down.

For my regular WordPress posts, I use a plugin that automatically stores any Media in my Amazon S3 bucket, keeping them out of my database which is really nice. It still stores all the metadata in MySQL, just not the files themselves which are the bulky part.

I'm trying to accomplish something similar with wpForo Advanced Attachments. I thought that maybe I could write a script to move files into my Amazon S3 bucket and then just change the wp_wpforo_attachments.fileurl value to the Amazon S3 value. But it's not working 🙁

I have a file that is currently sitting in two places:

But when I try updating the wp_wpforo_attachments.fileurl value in the database to the 2nd place like this ...

image

... the attachment no longer appears in the post. Any ideas how I can accomplish this?

3 Replies
Astghik
Posts: 3119
Admin
(@astghik)
Support Team
Joined: 2 years ago

Hi @tim40,

I thought that maybe I could write a script to move files into my Amazon S3 bucket and then just change the wp_wpforo_attachments.fileurl value to the Amazon S3 value. But it's not working

I'm sorry, but currently, it's not possible yet. The plugin checks if the file is on the local side using the  file_exists( ) function.

.. the attachment no longer appears in the post. Any ideas how I can accomplish this?

As far as you've deleted the file from the local side and it's located on another server the files are not being available anymore. 

We're going to check this and make the wpForo Advanced Attachments to work in this way in future releases. However, we'll need a bit more information. Please let us know the plugin you're using for this purpose. 

Reply
Tim Rodman
Posts: 9
Customer
(@tim40)
Member
Joined: 2 years ago

Bummer, but that would be AMAZING if you could add that in a future release!

I'm using two plugins (Amazon Web Services and WP Offload Media Lite) to make the AWS S3 magic work. When you upload an attachment/screenshot, it still puts it in the Media Library like you would expect, but when you Edit the file, you can see that the physical file is stored in Amazon S3:

image

I'm also using the OnePress Image Elevator plugin to allow me to do Ctrl-V to paste an attachment into a WordPress Post, but you already have that feature now in wpForo Advanced Attachments which is REALLY COOL (I LOVE it). So if you could handle the Amazon S3 portion too, that would be REALLY compelling.

I'd be happy to give you access to my Sandbox if you'd like to see Amazon Web Services and WP Offload Media Lite in action. Just keep in mind that it's using my LIVE AWS S3 account so you'd need to be careful.

Reply
1 Reply
Astghik
Admin
(@astghik)
Joined: 2 years ago

Support Team
Posts: 3119

Hi @tim40

Thank you very much for providing detailed information..

I'd be happy to give you access to my Sandbox if you'd like to see Amazon Web Services and WP Offload Media Lite in action. Just keep in mind that it's using my LIVE AWS S3 account so you'd need to be careful.

Thanks. I'll let you know if it'll be necessary. 

Reply
Share: