Page 1 of 1
Amazon S3 support
Posted: 07 Aug 2012, 21:36
by xpla
Hi,
i was wondering if Amazon S3 support is somehow possible, or at least via hack.
I thought about doing the following:
- mount S3 in local server filesystem
- phocagallery stores the files automatically to amazon s3
- create dns entry for images.yourdomain which represents amazon s3
- tell phocagally to pull the pictures from images.yourdomain ... gallery/name/pictures
Basically it wouldn't be that big of a deal by just changing the url generation though Joomla is quite a little bit a mess. So i wasn't able to find the function for creating the url of a picture/thumbnail. I'll have to invest more time in the files of phocagallery. But maybe someone could guide me in the right direction.
Chris
Re: Amazon S3 support
Posted: 09 Aug 2012, 00:52
by xpla
Anyway. Got a working solution and it rocks

Re: Amazon S3 support
Posted: 14 Aug 2012, 13:25
by Jan
For now I don't have any experiences with tihs

so cannot give any clue advice there
Jan
Re: Amazon S3 support
Posted: 17 Aug 2012, 23:39
by xpla
It's an unobtrusive "hack" where no source code is touched.
I let phoca gallery create the gallery and the according thumbs, move the files to amazon and replace the files on the server where phoca is located with 0byte files.
A htaccess file does the magic and pulls the images from Amazon.
A more elegant solution will be if links will be natively created for Amazon S3 though i really lost myself in the source code of Coda as it's, sorry to say that, a little bit messy.
Though if wanted we could team up as i'd be happy to develope a solution for natively store files to S3 (as it's also possible to push files via PHP to S3, so no native file storage required, except temp files).
Re: Amazon S3 support
Posted: 25 Aug 2012, 15:32
by Jan
Hi, yes, if you will have a solution for this, just paste it here to forum.
Will be great.
Thank you, Jan
Re: Amazon S3 support
Posted: 23 Nov 2013, 13:09
by sfam2708
Hi the simplest way to handle phoca gallery with amazon support is by using for example ja amazon component it's easy and simple. However there remains one problem even though the transfer of files is successfully transferred and transmitted back to the website and works 100%. If then the local files are deleted from the local server. The local database entries are also deleted therefore when an image is called up there is no record in the database and the callback fails.

The database reference must remain on deletion because it contains the reference to amazon.
There is also another main issue forgetting about amazon. When a file is deleted the database entry is removed but all the images remain in the image folder leaving the image folder with obsolete or no required images on a large site this creates major problems with backups and space. Also if a image with the same file name gets uploaded at a later time the upload files because the obsolete image exists in the image directory. In this case the correct code is required to remove the image from the image directory when a image is deleted.
In short in this day and age using a cloud storage platform is not only required but compulsory for all extensions. The code and database really need to have the option of the above 2 examples.
1: If transferring to cloud storage delete all files in the archive but keep the database reference.
2: If wanting to delete a file before transfer delete both file and database entry.
Most extensions that I use this method and works fine.
The lines of code required for this is both simple and effective. Beats writing a full code that encompasses the transfer and retrieving of images.