Post by codeM0nK3Y » Sat May 14, 2011 7:52 am

It's arrived! Latest version is available on the OpenCart Extensions store.

Changelog

v0.2.1 - 04/05/2012
  • Added URL cloaking option so you can hide the fact that you're using S3
  • Completely rewritten the models
  • Added installer/updater - no more need for install.sql!
  • No longer uses its own table to store config values
v0.2.0 - 04/02/2012
  • Removed debug code I previously forgot about
  • Added installation check to the plugin's config page
  • Added the ability to create a bucket directly through the Opencart backend
  • Tweaked the config info messages to better reflect the functionality of the pro version
  • Added 3 new upload methods: "Local" upload, and two ways of selecting an existing S3 file
  • Removed version from the install MySQL dump
  • Fixed Opencart 1.5 theme/layout bugs
v0.1.1 - 28/12/2011
  • Added MySQL table dump
  • Added support for OpenCart 1.5.x
  • Aws system dir is no longer hidden
  • Removed version-specific VQMod files
  • Stripped unnecessary comments
  • Swapped filename/token so the file extension is at the end
  • Added if_object_exists() check to avoid Warnings
v0.1.0 - 27/12/2011
  • First release


Original post below:

Disclaimer (of sorts)
First off, it's not integration with a script as such, more a service. It's not quite a contribution yet though so I guessed this'd be the best place to post.

Some Background
I've been working on a client's site to integrate Amazon S3. They'll be selling PDF back-issues of magazines, most of which are over 100MB so instead of shelling out for a dedicated server they wanted to use Amazon S3. OpenCart is by far the easiest to use from the ones I've had experience with, and the code is generally much better than others such as Magento and Pinnacle Cart. And so, I was granted the task of getting OC+S3 to play nicely together.

Preliminary Research
I've done some searching to see if anyone had done it before, and every result said no([1]), one stating that "it won't be easy to change it to work with s3" because "the download system uses a dynamic naming convention" ([2]).
Other sources:
[3] [4].

Plan for Release?
If there's enough interest I'll "vQmodularise" the extension for safer upgrades and release it. Not sure yet whether it'd be free, paid-for, or a free version and a "pro" version with extra features. It's being developed on 1.4.9.4 but I'll test other versions if I release it. For each version it works with, I'll include the two pre-patched index.php's needed for vQmod as well to save time.

What It Does Now
Currently it has a page in the backend where you enter your Account ID and Secret Key. Then a dropdown will be populated with a list of your buckets, with an option to create one if needed. Once it's setup, you simply add a download as normal and the file will be uploaded directly to your bucket without ever being saved to your server (except to PHP's tmp folder, but that's unavoidable). A customer would then come along and simply by the product as normal, accessing the link on the downloads page in My Account. All "objects" are stored in S3 with private access. As a result, using a "normal" link to the file will end up with an access denied page, so it will get a time-limited URL instead. This is currently set to 5 minutes, but I'm thinking of extending it. I've also pondered adding some Javascript to the downloads page that will auto-reload at the same interval as links expiring.

...and to summarise...
So what do you think? Is this something you'd use or have been looking for? If you wouldn't mind paying for it, what sort of price would you be happy to pay? Perhaps you'd like a free version with the choice of paying for extra features? One example could be storing downloads across different buckets rather than all-in-one. If the current implentation doesn't quite fit your needs, what's that missing feature that'd stop you from using it? If you have any ideas, post them and if enough people want it or I think it will add to the extension, then I'll probably add it in.

Think that's everything covered, probably went on a bit long though... Ahwel, "stuff" happens.
Last edited by codeM0nK3Y on Fri Jan 04, 2013 11:41 am, edited 5 times in total.

Newbie

Posts

Joined
Sat May 14, 2011 12:59 am

Post by azhdanov » Mon Aug 08, 2011 12:33 am

Hi,

Could you please share further details, I'm interested of opencart support for amazon s3, and would like to adopt your solution to my site.

Thank you.

Newbie

Posts

Joined
Mon Aug 08, 2011 12:30 am

Post by rumcious » Tue Oct 04, 2011 1:33 pm

Been looking into this recently and so far this is the only 'real' topic on the subject, so... what was/is the status of this potential mod, did it come to fruition? With the greater push of cloud based services it'd certainly be advantageous to add this as an ability, especially as there aren't many carts supporting this right now. You'd obviously get greater uptake with a free version but I'm not sure how you would limit it capabilities to encourage 'pro' purchase without compromising the mods functionality? Manually entering key data instead of auto generating it perhaps?

Newbie

Posts

Joined
Tue Oct 04, 2011 12:10 pm

Post by azhdanov » Tue Oct 04, 2011 7:44 pm

I did not work on integrating it into opencart, but worked out simple PHP class that will generate expirable link to S3, see attachment.

Attachments


Newbie

Posts

Joined
Mon Aug 08, 2011 12:30 am

User avatar
Active Member

Posts

Joined
Fri Nov 27, 2009 3:40 pm
Location - Bangkok - Thailand

Post by rumcious » Wed Oct 05, 2011 4:37 am

@ amdev: What we're after here is integrating Amazons S3/CloudFront et-al services as a distribution system for downloadable (digital) goods, the example you gave, whilst it appears to be serving content from Amazon, is only really doing that relative to 'affiliate' image (<iframe>?) placements.

@ azhdanov: what's the usage (instructions for use) on the script?

I'm assuming the OP and project are dead? Tis' a shame as it's something that's needed these days.

Newbie

Posts

Joined
Tue Oct 04, 2011 12:10 pm

Post by dony_b » Wed Oct 05, 2011 10:33 pm

azhdanov wrote:I did not work on integrating it into opencart, but worked out simple PHP class that will generate expirable link to S3, see attachment.
Where do you upload this script exactly ?

User avatar
Active Member

Posts

Joined
Wed Aug 18, 2010 9:56 pm
Location - Boston, MA

Post by rumcious » Thu Oct 06, 2011 2:13 am

Can you see the file attached to his message, "s3.php"?

Newbie

Posts

Joined
Tue Oct 04, 2011 12:10 pm

Post by dony_b » Thu Oct 06, 2011 2:24 am

rumcious wrote:Can you see the file attached to his message, "s3.php"?
Yes I downloaded it but not sure where to upload it ? It looks like its working on his site

Do you have any idea ?

User avatar
Active Member

Posts

Joined
Wed Aug 18, 2010 9:56 pm
Location - Boston, MA

Post by rumcious » Sun Oct 30, 2011 4:01 am

What site? azhdanov didn't post any links.

I'm still looking into this issue but one way to solve it without necessarily changing anything in OpenCart would be to upload a php/html/etc file as the actual stores 'product'. This 'product' is simply a script/function/whatever (.php/.asp/.html) that runs when activated (the user clicks a link and/or it auto-starts) that has or generates the link to the S3 bucket or CloudFront distribution (script could be formatted to serve secure or public files). This potentially gets around the problem of php memory limits when serving large files using OpenCart - my understanding is that memory only runs/is needed loading up the initial 'product' script (file). I think this is what azhdanov S3.php file does and hows it's supposed to be used.. not sure though, looking through it I can't make head-nor-tail as to where it gets the critical identifying information (the key pairs) that allow access.

The only downside I can see doing this is that OpenCarts download counter would only count the initial product serving (the original .php etc. uploaded to the store), it won't log the actual file being served from S3/CFDist; any problems there would mean having to manually send customers time limited links manually. There's probably a way to get Amazon to ping-back using their API though. But yah.. needs someone that knows what they're doing.. right?

Newbie

Posts

Joined
Tue Oct 04, 2011 12:10 pm

Post by smifis » Mon Nov 14, 2011 9:36 am

Hi,

I have already made a script which uploads to s3,
http://www.opencart.com/index.php?route ... order=DESC

Active Member

Posts

Joined
Sat Jan 15, 2011 10:37 pm


Post by rumcious » Mon Nov 14, 2011 6:43 pm

Cheers, but that doesn't do what's being discussed here. What's needed is a way to integrate S3/CloudFront as a storage location for digital distribution of content. This isn't the same thing as storing or hosting site files, particularly when 'private' location security is involved.

Newbie

Posts

Joined
Tue Oct 04, 2011 12:10 pm

Post by smifis » Wed Nov 16, 2011 6:31 pm

Oh sorry, miss read it.

That could be done too, all you would need to do is modify the image.php file in model.

Active Member

Posts

Joined
Sat Jan 15, 2011 10:37 pm


Post by hgrimberg » Sat Dec 10, 2011 2:45 pm

You could also try mapping a directory within the file root to S3 via FUSE. Then you could simply change the path in opencart to that.

User avatar
New member

Posts

Joined
Wed Jun 23, 2010 9:51 pm
Location - USA

Post by codeM0nK3Y » Tue Dec 27, 2011 6:37 pm

rumcious wrote:I'm assuming the OP and project are dead? Tis' a shame as it's something that's needed these days.
No, merely in a coma. Apologies for the complete lack of replies on here, I've only just found the time to work on my own projects.

I've finally got all the basic functionality in the plugin and packaged it up as a download. Installation/usage instructions are available in the readme, but essentially all you have to do is paste in your Amazon details, select a bucket, then add downloads as you would before.

No need to worry about any existing downloads, they'll all still work the same way so you don't have to reupload everything. Once the plugin is installed, all downloads will be uploaded directly to Amazon S3. In a future release I'll be adding a switch so you can choose whether to store a download locally or in your bucket.

Download Amazon S3 plugin for OpenCart 1.4.9.4

Note: Support for more versions will be added in the near future. Once I've uploaded it to the Extensions Directory I'll post a link to that as well.


Update: Plugin's page in the OpenCart Extensions Directory

Newbie

Posts

Joined
Sat May 14, 2011 12:59 am

Post by dony_b » Wed Dec 28, 2011 12:18 am

codeM0nK3Y wrote:
rumcious wrote:I'm assuming the OP and project are dead? Tis' a shame as it's something that's needed these days.
No, merely in a coma. Apologies for the complete lack of replies on here, I've only just found the time to work on my own projects.

I've finally got all the basic functionality in the plugin and packaged it up as a download. Installation/usage instructions are available in the readme, but essentially all you have to do is paste in your Amazon details, select a bucket, then add downloads as you would before.

No need to worry about any existing downloads, they'll all still work the same way so you don't have to reupload everything. Once the plugin is installed, all downloads will be uploaded directly to Amazon S3. In a future release I'll be adding a switch so you can choose whether to store a download locally or in your bucket.

Download Amazon S3 plugin for OpenCart 1.4.9.4

Note: Support for more versions will be added in the near future. Once I've uploaded it to the Extensions Directory I'll post a link to that as well.


Update: Plugin's page in the OpenCart Extensions Directory
when you plan on adding the 1.5x

User avatar
Active Member

Posts

Joined
Wed Aug 18, 2010 9:56 pm
Location - Boston, MA

Post by codeM0nK3Y » Wed Dec 28, 2011 1:51 am

dony_b wrote:when you plan on adding the 1.5x
I'll hopefully be adding support for 1.5.x really soon (if not tonight, then within the next couple days). There are other features to add/improve as well so lots to do, but compatibility is key until the latest versions are supported.
Last edited by codeM0nK3Y on Wed Dec 28, 2011 11:16 am, edited 1 time in total.

Newbie

Posts

Joined
Sat May 14, 2011 12:59 am

Post by dony_b » Wed Dec 28, 2011 2:16 am

codeM0nK3Y wrote:
dony_b wrote:
codeM0nK3Y wrote:when you plan on adding the 1.5x
I'll hopefully be adding support for 1.5.x really soon (if not tonight, then within the next couple days). There are other features to add/improve as well so lots to do, but compatibility is key until the latest versions are supported.
Awesome I can test the compatibility and let you know how it looks..

User avatar
Active Member

Posts

Joined
Wed Aug 18, 2010 9:56 pm
Location - Boston, MA

Post by codeM0nK3Y » Wed Dec 28, 2011 2:58 am

dony_b wrote:
codeM0nK3Y wrote:
dony_b wrote:when you plan on adding the 1.5x
I'll hopefully be adding support for 1.5.x really soon (if not tonight, then within the next couple days). There are other features to add/improve as well so lots to do, but compatibility is key until the latest versions are supported.
Awesome I can test the compatibility and let you know how it looks..
I've had a quick look at the source of any core files that need to be modified and it doesn't look like there's a massive amount of difference between 1.4.x and 1.5.x where the downloads are concerned. So far it seems that I'll only have to modify the code that adds the nav link in the backend, but that's nothing! Next version could be hear sooner than I thought ;)

There's also some nasty debug code being output in the Downloads page (client-side), so I'll get that fixed in the next release too.

Newbie

Posts

Joined
Sat May 14, 2011 12:59 am

Post by codeM0nK3Y » Wed Dec 28, 2011 11:22 am

Version 0.1.1 is now up in both locations. This release adds support for OpenCart 1.5.x. For the changelog and download links, check the first post.

If you already downloaded 0.1.0 before, follow the installation instructions in the readme as normal, then re-upload your files. There was an issue before where file extensions ended up in the middle somewhere, which has now been fixed. As a result, all your downloads will point to the wrong file in your bucket.

Newbie

Posts

Joined
Sat May 14, 2011 12:59 am
Who is online

Users browsing this forum: No registered users and 9 guests