Script to add files in S3 bucket folder and add files on new location using S3 api or s3fs module.

Script to add files in S3 bucket folder and add files on new location
try {
$config = _s3fs_get_config();
$s3 = _s3fs_get_amazons3_client($config);
catch (S3fsException $e) {
form_set_error('form', $e->getMessage());
return FALSE;

Views S3

Project URL:


This module is useful for any kind of integration with the S3 hosting system, and uses the official AWS SDK for PHP library from Amazon through the AWS SDK for PHP module. An example use case would be a private/authenticated video delivery network that stores videos using Amazon’s S3 hosting solution.

Installation & Setup of the Amazon S3 1.x Module

NOTE: This is only for the 1.x version of the module. For 2.x see the module summary page.


Amazon S3 module
Libraries (7.x-2.x branch) module
Amazon Web Services SDK for PHP module

Installation & Setup:

  1. Download and install the Amazon S3, Libraries, and AWS SDK drupal modules. For installation of AWS SDK module you will need to download the Amazon SDK for PHP library v.1.6.2. Download the file to your "sites/all/libraries/" directory. Extract the archive and rename the extracted directory from "sdk-1.6.2" to "awssdk". The final path to sdk.class.php should be "sites/all/libraries/awssdk/sdk.class.php".
  2. Verify that the AWS SDK can be loaded by visiting your site's status report at admin/reports/status; if the status reports indicates that the library cannot be loaded properly even after you verify that it is properly installed, clear all caches to ensure that the Libraries module uses the most up-to-date information
  3. Configure AWS SDK (You will need your two Security Credentials: Access Key ID and Secret Access Key. These are located in your account settings at
  4. Configure your bucket settings at /admin/config/media/amazon or /admin/config/media/amazons3

Utilizing Cloudfront Support

Amazons CloudFront service can be utilized by following these steps:

Without custom domain:

  1. Create a CloudFront distribution for your Amazon S3 Bucket.
  2. In the Amazon S3 module settings, check the Enable CNAME box.
  3. In the CDN Domain Name field enter your CloudFront distribution domain name (e.g.
  4. Save the configuration and then clear the Drupal cache.

To use a custom domain:

Local file system replacement: Amazon S3 (D7)

The AmazonS3 module allows the local file system to be replaced with S3. Uploads are saved into the drupal file table using D7's new file/stream wrapper system.

You can switch it on as the default file system scheme, or individually for file and image fields.

It includes support for Amazon Cloudfront as well, through the use of a CNAME.

Subscribe with RSS Subscribe to RSS - amazon s3