Download the PHP package firebrandhq/s3fileupload without Composer
On this page you can find all versions of the php package firebrandhq/s3fileupload. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download firebrandhq/s3fileupload
More information about firebrandhq/s3fileupload
Files in firebrandhq/s3fileupload
Package s3fileupload
Short Description Extend the SilverStripe UploadField to allow storing file in Amazone S3
License MIT
Informations about the package s3fileupload
Firebrand SilverStripe S3FileUpload
This SilverStripe plugin allows file to be uploaded directly to S3 and track as SilverStripe DataObjects.
Requirements
- SilverStripe 3.1
- AWS SDK for PHP v3
Installation
Install the module through composer:
Setting up your S3 bucket
To be able to do a direct up load to S3, your bucket must have CORS Configuration. To Set up your CORS configuration:
- Log into S3 and access your bucket.
- Select Properties to view your bucket properties.
- Under Permission, select Edit CORS Configuration.
- In the pop up, input your CORS configuration in XML format.
Sample CORS configuration
Note that you'll need a separate CORSRule
entry for each domain from which you plan to upload files.
You'll also need a CORSRule
entry for each protocol.
Getting an Access Key and a Secret
You'll need to generate an AWS Access Key ID and Secret Access Key to allow SilverStripe to communicate with S3.
For security reasons, it is STRONGLY RECOMMENDED to create a new user with limited access. This will minimise the damage should your Access Key and/or Secret ever be compromised.
Sample Policy for your AWS user
Configuring SilverStripe
You can use a YML config file to tell SilverStripe how to access your bucket.
Create a s3.yml
file in mysite/_config
.
You don't have to provide the Bucket or Region in YML file if you don't want to. Those can be manually set on your S3FileUploadField.
Adding an S3File to a SilverStripe DataObject/Page
Reference the file in your SS Template
All versions of s3fileupload with dependencies
composer/installers Version *
aws/aws-sdk-php Version 3.*