You are here

function hook_s3fs_stream_open_params_alter in S3 File System 8.3

Same name and namespace in other branches
  1. 4.0.x s3fs.api.php \hook_s3fs_stream_open_params_alter()

Alters the S3 file parameters when stream is opened.

Parameters

array $stream_params: Associative array of upload settings.

string $s3_file_path: The path to the file within your S3 bucket. This includes the prefixes which might be added (e.g. s3fs-public/ for public:// files, or the S3FS Root Folder setting).

See also

https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-s3-2006-03-01.html#ge...

1 invocation of hook_s3fs_stream_open_params_alter()
S3fsStream::stream_open in src/StreamWrapper/S3fsStream.php

File

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

Code

function hook_s3fs_stream_open_params_alter(array &$stream_params, string $s3_file_path) {
  if (strpos($s3_file_path, 'private/') !== FALSE) {
    $stream_params['SSECustomerAlgorithm'] = 'AES256';
    $stream_params['SSECustomerKey'] = 'MySecureKey';
  }
}