Welcome, Guest
Username: Password: Remember me

TOPIC: AMAZON CloudFront and S3 2 store uploaded files

AMAZON CloudFront and S3 2 store uploaded files 11 Oct 2012 14:58 #4415

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
Dear COOKS,

Background
I've long used JoomlArt's S3/Cloudfront component to synchronise certain file types and directories from my webserver to specific amazon S3 buckets & CloudFront distributions. There's nothing wrong with this approach at all, and in fact, it can be a very effective way of managing the automatic switching of http requests for such assets dynamically. However, the drawback of this mechanism is that;
  1. It relies on a 3-rd party piece of software and I would like to integrate it directly into my component
  2. It relies on first, storing your assets on your local webserver then synchronising them - either through a cron job or manually by sync'ing in a profile. This isn't desirable as it means you have to;
    • Use unnecessary bandwidth to upload to your host first
    • Use unnecessary disk space on your server - space you may not have - to upload to your web host in the first instance. Example, In a relatively small media-orientated site, I had to increase disk space from 1GB to 5GB to reduce how often I could flush my webserver's media directories not to have to a reasonable amount of time. For a component that is centred around constant upload of user-generated video/audio content, this would be an administrative nightmare and far too expensive
  3. [/olI briefly read through some of their docs concerning remote uploading and storage of files and images (with thumbnail generation) earlier and on a positive note, it is CLEARLY POSSIBLE :woohoo: However, the process of integrating this functionality into a joomla component obviously adds another dimension of complexity.
Proposed Use in component
  1. A config table to store to store;
    S3 bucket/Cloudfront Credentials to access
    • CNames - allow access to the buckets my.alias.domain.com type addresses instead of d1xxxxxxxx.cloudfront.net
    • Time - the length of time in mins to set the expiration time of links - securty
    • + various others as required
    All of which combine to allow admins to create multiple profiles with which to store/retrieve files with individual bucket policies to protect direct access to the files outside of the component
  2. I would also want the size of thumbnails for component specific image directories to be inherited from the component's params
I therefore wonder, does anyone have any experience of this - either straight file upload and/or images with processing - to any degree whatsoever?

Any ideas, pointers, do's & don't's greatly appreciated!

many thanks,

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
Last Edit: 11 Oct 2012 15:28 by JoomGuy. Reason: typo
The administrator has disabled public write access.

Re: AMAZON CloudFront and S3 2 store uploaded files 13 Oct 2012 08:31 #4440

  • VeCrea
  • VeCrea's Avatar
  • Offline
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
  • Karma: 30
Man... and i thought my ideas were on the wild side....
The administrator has disabled public write access.

Re: AMAZON CloudFront and S3 2 store uploaded files 13 Oct 2012 09:01 #4442

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
It's not that wild :lol:

It actually looks ok in itself but a bit more complicated on the MVC integration side...

Questions like;
  1. Should it be a utility function?
  2. OR
  3. embedded in the model
AND also, how to handle image thumbnails? I read in one post relating to a utility class that one dev has released for handling thumbnails within the class however, he's using some image processor that I'd not heard of before...

Anyway, if you're interested, here are the links to the docs I was reading....
S3 PHP SDK
UPLOADING
Batch Put files in S3
Asynchronous Uploads to S3
LISTING
Bucket Listing from S3
Standalone PHP Class for S3
IMAGE PROCESSING
Processing Images/Amazon S3
CLOUDFRONT
CloudFront in PHP

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
The administrator has disabled public write access.

Re: AMAZON CloudFront and S3 2 store uploaded files 13 Oct 2012 09:06 #4444

  • VeCrea
  • VeCrea's Avatar
  • Offline
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
  • Karma: 30
With version 1.5, all i added was always added either in the model, or in admin/tables.
With version 2.0, it has changed quite a bit from my point of view, so i'm still re-learning how to deeply customize my downloaded components
The administrator has disabled public write access.

Re: AMAZON CloudFront and S3 2 store uploaded files 13 Oct 2012 09:12 #4446

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
I suppose there is also the question of retrieval of those images... Putting them is one thing - one class/function - then getting them will be another

Access policy, signing the urls to prevent direct access where necessary - I mean, for files, not images - and all that junk!

Lots to think about but I think that this may have to go on a much more mature version of my component.

Cheers,

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
The administrator has disabled public write access.

Re: AMAZON CloudFront and S3 2 store uploaded files 13 Oct 2012 09:15 #4447

  • VeCrea
  • VeCrea's Avatar
  • Offline
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
  • Karma: 30
And it goes beyond my skills of coder ;-)
The administrator has disabled public write access.

Re: AMAZON CloudFront and S3 2 store uploaded files 13 Oct 2012 09:22 #4450

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
Mine too! I just can't stand not knowing how to do something... Even if I must die trying, I will try to keep going until I can do it.

I only got into web stuff having been mislead, mis-sold, over-charged and ripped off by devs who promised the world and delivered next-to-nothing. So, being able to do what they always said, "Yeah, you can have that... but it'll be custom coding..." is my motivator! That and not ripping people off!

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
The administrator has disabled public write access.

Re: AMAZON CloudFront and S3 2 store uploaded files 14 Oct 2012 21:47 #4506

  • admin
  • admin's Avatar
  • Online
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
I keep the link for the moment it is really interresting.

Unfortunatly, I am affraid it to be too much specific for the moment.
Let's keep the idea somewhere, because this concept is very good, and integrated in Cook can be very usefull.
Coding is now a piece of cake
The administrator has disabled public write access.

Re: AMAZON CloudFront and S3 2 store uploaded files 14 Oct 2012 21:52 #4508

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
I'll keep this thread up-to-date when I make any progress.

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
The administrator has disabled public write access.
The following user(s) said Thank You: admin
Time to create page: 0.141 seconds

Get Started