[ABD] Using Amazon S3 Simple Storage

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
mmorgensen
Registered User
Posts: 4
Joined: Wed Feb 20, 2008 4:35 am

[ABD] Using Amazon S3 Simple Storage

Post by mmorgensen »

MOD name: Amazon S3 Simple Storage

MOD description: Allows you to use Amazon s3 for attachment storage

MOD version: dev - 0.0.0

More info:

I've been working on this for the past week because of a need for my website. I've seem numerous requests to have code on how to do this, so I wanted to share my progress/ideas.

I pretty much hacked around to get this to work, so I claim nothing. :) This is DEV code, use at your own risk.

This code was designed for Images, but could be easily modified for other attachments.

This code will:
Upload a file and thumbnail to Amazon S3 Service.
Delete a file, and thumb, if the user presses "delete file" before submitting the post.
Delete the file, and thumb, if the post is deleted.

The file/code to display the photo inline within a thread was hacked to make it work. Basically it will expose the raw file name.


A few "gotchas":
1.) The uploaded files are not deleted off the local HDD. I may add this, but for the time you can just run a cron job to delete all files.
2.) You need PHP5 installed on the server.
3.) You need PHP5-CURL installed.
4.) See the readme.txt for additional files needed.
5.) The code hardcodes the file type to jpeg/image, however it appears to work with PNG, GIF, and other file types.


Comments welcome!

http://mmorgensen.s3.amazonaws.com/phpbb3-s3-0.0.0.zip
eugene187
Registered User
Posts: 108
Joined: Sun Aug 15, 2004 4:05 am

Re: [DEV] Using Amazon S3 Simple Storage

Post by eugene187 »

if you need anyone to assist in testing this please feel free to send me a msg :)

-e
User avatar
batfastad
Registered User
Posts: 113
Joined: Sat Aug 02, 2003 5:35 pm

Re: [DEV] Using Amazon S3 Simple Storage

Post by batfastad »

I will be trying this out very soon!
I'd love to see a Mod to store attachments in an Amazon S3 bucket. IMO this and storing attachments on remote FTP server should be standard features of phpBB.
I like to keep attachments on separate servers from my scripts and forum files

Will let you know how I get on with this Mod

Thanks, B
nbethmann
Registered User
Posts: 2
Joined: Tue Dec 02, 2008 3:52 pm

Re: [DEV] Using Amazon S3 Simple Storage

Post by nbethmann »

Did you make any progress on this?

I used S3 with another BB and it worked great. However, I made it simple and had a separate daemon that uploaded the images to S3 and then put the URL in the database so that the BB code only needed to see if there was an alternate URL and issue a redirect. The end user never had a clue the images were coming off S3.

-n
nbethmann
Registered User
Posts: 2
Joined: Tue Dec 02, 2008 3:52 pm

Re: [DEV] Using Amazon S3 Simple Storage

Post by nbethmann »

I got my BB working with S3. I just added a "redirect_url" column to the attachments table and in the file.php page I see if that has a value and redirect to that url. This is the easy part.

Add the column, redirect_url, to the select on line 239 and change the code around line 298 to this:

Code: Select all

    if (strlen($attachment['redirect_url']) > 0)
        header( "Location: ".$attachment['redirect_url'] );
    else 
        send_file_to_browser($attachment, $config['upload_path'], $display_cat);
    file_gc();
The slightly harder part was modifying one of my old S3 sync apps to read from the phpBB database and copy the attachment to S3 and then update the attachment table. Once I got that working, I just scheduled it to run every few hours. I don't get a lot of attachments so that is often enough for me.
User avatar
bbthailand
Translator
Posts: 76
Joined: Wed Jun 18, 2008 6:00 am

Re: [DEV] Using Amazon S3 Simple Storage

Post by bbthailand »

in process now ?
balashine
Registered User
Posts: 2
Joined: Tue Jun 25, 2013 9:13 am

Re: [DEV] Using Amazon S3 Simple Storage

Post by balashine »

Hi mmorgensen

I need to store the attachements of my post to Amazon s3. I Found your mod which related to my requirement , but i can't able to download the source for this mod , when i load this url http://mmorgensen.s3.amazonaws.com/phpbb3-s3-0.0.0.zip its show permission denied and some other, if you provide the source means it will helpful for me to integrate for my site .
User avatar
prototech
Former Team Member
Posts: 5406
Joined: Mon Mar 19, 2007 2:04 pm
Location: Southern California

Re: [DEV] Using Amazon S3 Simple Storage

Post by prototech »

This topic has been marked as [ABD] - Abandoned as the mod author has not been active recently. If the MOD author wishes to continue development, please PM anyone on the MOD Team to request this topic be unlocked.

Notice!
We do not recommend that a user of the phpBB software install this mod, or any other mod that is marked as “abandoned” or “in development”, on a live forum. Doing so may cause your forum to not perform in the manner it should.


Thank you,
The phpBB Modifications Team
Need help with MOD/style installations or other phpBB problems? Contact me for a quote.

Return to “[3.0.x] Abandoned MODs”