uc_file_amazon_s3

Contrib type: 
Module
Status: 
Initial upload
Compatibility: 
Ubercart Alpha 8

File Download Product served from Amazon S3 for Ubercart.

Product downloads are stored and served on/from your Amazon S3 account. All files are set at private, so the files are secure. Preventing people from downloading them without first buying them.

All features of the original uc_file module are functional.

Update: May 28, 2008 I got a private message from someone asking me about the state of this module. I uploaded my current code which I use on several sites with Ubercart RC4. Basically overwrite the uc_files module with these files. I haven't done anything with it for long time. Read the readme. But here it is, and it works, but the way it works is you have to setup a subdomain and point it to amazon s3 via cname record change, and create bucket with full subdomain name. Probably none of this makes sense.

Currently this is a wholesale replacement of uc_file. Meaning you can NOT use both at the same time because I didn't change the module name.

The code is identical to uc_file except I changed the relevant parts to interface with Amazon S3 instead of your local file system.

You need an Amazon S3 account. And you have to edit the s3.class.php file by adding in the API key ID and secret key that you get from Amazon.

The your bucket name must be unique across all Amazon S3 accounts.

The only current limitation is the size of uploaded files. As they first have to be uploaded to your server and then transferred to Amazon. They claim that they will be releasing a new feature to upload straight to Amazon from a post form by the end of the year.

There is also not much in the way of error checking, if something fails. In particular file uploads.

So I wanted feedback as to whether I should make a new module or try to combine the two? I'm sure people will say combine them, but I'm not really up to doing the work for that.

AttachmentSize
uc_file.zip38.57 KB
uc_file.zip (May 28, 2008)45.03 KB



Re: uc_file_amazon_s3

Awesome work! Honestly, I don't mind if you leave this up here as a wholesale replacement of uc_file.module, though we'll understandably need to keep the core module storing files locally. If you ever get the chance to merge it somehow, let me know.

The main problem here is if a bug gets fixed in the core module it won't necessarily get ported to yours. You can use our commit log to see when uc_file.module gets changed.

Re: Re: uc_file_amazon_s3

Yes I plan on keeping it up to date.

Probably every time you make a new release.

Re: Re: Re: uc_file_amazon_s3

Either way you go (standalone replacement or separate module), you're going to have to keep up maintenance with changes with uc_file and other core modules. That being an unavoidable issue, I think, for the sake of keeping the codebase small, that a separate module is the way to go. Using hooks like hook_form_alter should enable you to modify the existing forms to add S3 functionality to the uc_file module. If you'd like assistance or need changes to uc_file to accommodate this module, PM me.

On the note about the code, I note in the README file that installation of the module requires you to edit one of the PHP files. I'd recommend storing this information in a drupal variable, by creating a form with system_settings_form. This makes the process of upgrading to future revisions much easier.