You are here

function hook_s3fs_upload_params_alter in S3 File System 8.3

Same name and namespace in other branches
  1. 8.2 s3fs.api.php \hook_s3fs_upload_params_alter()
  2. 7.3 s3fs.api.php \hook_s3fs_upload_params_alter()
  3. 7 s3fs.api.php \hook_s3fs_upload_params_alter()
  4. 7.2 s3fs.api.php \hook_s3fs_upload_params_alter()
  5. 4.0.x s3fs.api.php \hook_s3fs_upload_params_alter()

Alters the S3 file parameters when uploading an object.

Parameters

array $upload_params: Associative array of upload settings.

See also

http://docs.aws.amazon.com/aws-sdk-php/latest/class-Aws.S3.S3Client.html...

3 invocations of hook_s3fs_upload_params_alter()
S3fsFileMigrationBatch::copyOperation in src/Batch/S3fsFileMigrationBatch.php
Batch operation callback that copy files to S3 File System.
S3fsFileService::putObject in src/S3fsFileService.php
Upload a file that is not in the bucket.
S3fsStream::stream_flush in src/StreamWrapper/S3fsStream.php

File

./s3fs.api.php, line 80
This file contains no working PHP code.

Code

function hook_s3fs_upload_params_alter(array &$upload_params) {
  if (strpos($upload_params['Key'], 'private/') !== FALSE) {
    $upload_params['ACL'] = 'private';
    $upload_params['SSECustomerAlgorithm'] = 'AES256';
    $upload_params['SSECustomerKey'] = 'MySecureSecureKey';
  }
}