You are here

function hook_s3fs_upload_params_alter in S3 File System 7.3

Same name and namespace in other branches
  1. 8.3 s3fs.api.php \hook_s3fs_upload_params_alter()
  2. 8.2 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

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

1 invocation of hook_s3fs_upload_params_alter()
S3fsStreamWrapper::stream_flush in ./S3fsStreamWrapper.inc
Support for fflush(). Flush current cached stream data to a file in S3.

File

./s3fs.api.php, line 62
This file contains no working PHP code; it exists to provide additional documentation for doxygen as well as to document hooks in the standard Drupal manner.

Code

function hook_s3fs_upload_params_alter(&$upload_params) {

  // An example of what you might want to do with this hook.
  if (strpos($upload_params['Key'], 'private/') !== FALSE) {
    $upload_params['ACL'] = 'private';
  }
}