CDN Upload
Component ID
2279297
Component name
CDN Upload
Component type
module
Maintenance status
Development status
Component security advisory coverage
covered
Downloads
983
Component created
Component changed
Component body
This is a module that provides Direct upload capabilities to CDN's. This is a great method to completely bypass the Drupal file system for large files such as large images and media. Currently, this module only supports Direct upload to Amazon S3, but more are coming soon.
Sponsor
This module was made possible through the contributions of Handsome Dog Studio.
Installation
- First clone https://github.com/Widen/fine-uploader into your sites/all/libraries folder so
that you have a sites/all/libraries/fine-uploader directory. - Now navigate to the fine-uploader directory and install Node.js as follows:
- You will now need to make sure you meet all the requirements for the awssdk2 module.
- Edit the CORS configuration of your amazon S3 bucket to the following (replace [your_domain_here] with a full url, e.g. http://drupal.org):
<?xml version="1.0" encoding="UTF-8"?> <CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <CORSRule> <AllowedOrigin>[your_domain_here]</AllowedOrigin> <AllowedMethod>POST</AllowedMethod> <AllowedMethod>PUT</AllowedMethod> <AllowedMethod>DELETE</AllowedMethod> <MaxAgeSeconds>3000</MaxAgeSeconds> <ExposeHeader>ETag</ExposeHeader> <AllowedHeader>*</AllowedHeader> </CORSRule> </CORSConfiguration> - You will now need to edit the bucket policy for your Amazon S3 bucket to the following.
{ "Version": "2008-10-17", "Id": "http referer policy example", "Statement": [ { "Sid": "readonly policy", "Effect": "Allow", "Principal": "*", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::your_bucket_name/*" } ] } - After you have all the modules enabled, you will now need to add your Amazon AWS credentials by going to /admin/config/aws/service
- You can then add a Text field to any content type, and then select "S3 Direct Upload" as the upload mechanism. Make sure you provide your Bucket name in the field configurations.
npm install
Enjoy.
