eZ S3 Upload is a true eZ Publish extension that provides a simple datatype to upload files directly from a client web browser to Amazon's S3 File Hosting Service
eZ S3 Upload extension README
What is the eZ S3 Upload extension?
eZ S3 Upload is a true eZ Publish extension
that provides a simple datatype to upload files
directly from a client web browser to
Amazon's S3 File Hosting Service
eZ S3 Upload Rename is a true eZ Publish cli
script and cronjob that provides a simple way
to rename s3 files from the admin ui.
eZ S3 Upload Client version
The current version of eZ S3 Upload Client is 0.4.2
Last Major update: June 1, 2013
eZ S3 Upload Rename version
The current version of eZ S3 Upload Client is 0.1.2
Last major update: June 9, 2014
Copyright
eZ S3 Upload is copyright 1999 - 2015 Brookins Consulting and Think Creative
See: doc/COPYRIGHT for more information on the terms of the copyright and license
License
eZ S3 Upload is licensed under the GNU General Public License.
The complete license agreement is included in the doc/LICENSE file.
eZ S3 Upload is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
eZ S3 Upload is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
The GNU GPL gives you the right to use, modify and redistribute
eZ S3 Upload under certain conditions. The GNU GPL license
is distributed with the software, see the file doc/LICENSE.
It is also available at http://www.gnu.org/licenses/gpl.txt
You should have received a copy of the GNU General Public License
along with eZ S3 Upload in doc/LICENSE. If not, see http://www.gnu.org/licenses/.
Using eZ S3 Upload under the terms of the GNU GPL is free (as in freedom).
For more information or questions please contact
license@brookinsconsulting.com
Requirements
The following requirements exists for using eZ S3 Upload Client extension:
o eZ Publish version:
Make sure you use eZ Publish version 4.x (required) or higher. eZ Publish 4.6.x+ (Community Build, 2011.11+) is recommended.
o PHP version:
Make sure you have PHP 5.x or higher.
o eZ JsCore:
Make sure you have ezjscore installed. ezjscore is required in ezs3upload.tpl template to load css and javascript dependencies.
Features
- Dattype is simple by design
- Datatype is based on ezstring
- Datatype stores only one file name without http host or path information making bucket migrations a simple as changing the bucket settings
- Bucket and Keys are stored as ini settings
- Datatype can upload more than one file
- Upload feature is not required; you can upload files by other methods and simply enter the filename into the content object attribute
- Scripts provided can upload local and remote files into Aws S3
- Class provided can also upload local and remove files into Aws S3
- Script to rename files in Aws S3 based on content tree changes and manually
Usage of datatype
- Make sure you have all the requirements (listed above).
- Unpack, Install and Activate extension.
- Regenerate eZ Publish PHP Autoloads
- Configure s3.ini.append.php settings: Key, SecretKey, Bucket
- Add datatype to content class.
- Upload crossdomain.xml into the doc root of your "S3 Bucket" using the "S3 Management Console". File is located in ezs3upload/doc/install folder.
- Edit a content object and upload (image) files to S3 directly from ezp administration GUI.
- Note: Only the filename is stored within the content object attribute -not- the full url to the bucket and file. This makes future migrations much simpler to update simply change the bucket name setting.
- Note: You can upload as many files as you want without storing the content object.
- Remember: Only the last file uploaded is stored within the content object attribute when the draft is stored or published.
Usage of aws s3 file rename support
- Make sure you have all the requirements (listed above).
- Unpack, Install and Activate extension.
- Regenerate eZ Publish PHP Autoloads
- Configure s3.ini.append.php settings: Key, SecretKey, Bucket
- Edit your aws s3 file content object class and add a checkbox with the content class identifier attribute of 'aws_s3_renamed'. Required by rename script. Identifier implemented as s3.ini setting.
- Publish a new version of a aws s3 file enabled class object with a s3 reference path change and uncheck the 'aws_s3_renamed' attribute checkbox.
- Run command line script or cronjob.
-- Script: /usr/bin/php -d memory_limit=-1 ./extension/ezs3upload/bin/php/ezs3rename.php --parent-node=2 --min=15 --script-verbose=true --script-verbose-level=2 --force
-- Cronjob: /usr/bin/php -d memory_limit=-1 ./runcronjobs.php rename_aws_s3_files
- Note: This solution is designed to be added to your crontab to run every 2 min.
Usage of command line scripts
- Make sure you have all the requirements (listed above).
- Unpack, Install and Activate extension.
- Regenerate eZ Publish PHP Autoloads
- Configure s3.ini.append.php settings: Key, SecretKey, Bucket
- Note: Only the filename is stored within the content object attribute -not- the full url to the bucket and file. This makes future migrations much simpler to update simply change the bucket name setting.
- Example of upload local file: ./extension/ezs3upload/bin/php/ezs3uploadfile.php --subdirectory=upload/ --file=var/cdev_base/storage/images/media/test-image-001/100076-3-eng-GB/test-image-001_reference.jpg --nodeid=5160 --permissions=read
- Example of upload remote file: ./extension/ezs3upload/bin/php/ezs3uploadfilebyurl.php --subdirectory=upload/ --url=http://tc/var/cdev_base/storage/images/media/test-image-001/100076-3-eng-GB/test-image-001_large.jpg --nodeid=5160 --permissions=read --storage-dir=var/import/ --removetempfile
- Example of the upload remote new files and update existing file content objects: ./extension/ezs3upload/bin/php/ezs3uploadfilesbyurl.php --subdirectory=upload/ --permissions=read --storage-dir=var/import/ --removetempfile
- Example of the upload remote new files and create new s3_file content objects: ./extension/ezs3upload/bin/php/ezs3uploadnewfilesbyurl.php --subdirectory=upload/ --permissions=read --storage-dir=var/import/ --removetempfile
- Example of the upload rename files based on changes in the admin: php -d memory_limit=-1 ./extension/ezs3upload/bin/php/ezs3rename.php --parent-node=2 --min=15 --script-verbose=true --script-verbose-level=2 --force
Troubleshooting
-
Some problems are more common than others. The most common ones
are listed in the the doc/FAQ.
-
If you have find any problems not handled by this document or the FAQ you
can contact Brookins Consulting through the support system:
http://brookinsconsulting.com/contact