s3fs_cors.api.php in S3 File System CORS Upload 7
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.
File
s3fs_cors.api.phpView source
<?php
/**
* @file
* 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.
*/
/**
* @defgroup s3fs_cors_hooks S3 File System hooks
* Hooks that can be implemented by other modules to extend S3 File System CORS Upload.
*/
/**
* Alters the options used when writing a file to the bucket using the CORS widget.
* To learn the valid values for these options, you'll need to be familiar with the
* PostObject class from the AWS SDK for PHP:
* http://docs.aws.amazon.com/aws-sdk-php/v2/api/class-Aws.S3.Model.PostObject.html
*
* @param array $options
* Associative array of options (defaults):
* - 'acl': (string) Set the access control for the file. Detault: 'public-read'.
* - 'Content-Type': (string) The file's mimetype, prefixed with ^.
* - key: (string) The filename in the bucket.
* - ttd: (string) How long the signed request should be viable. Default: "+5 minutes".
*
* More values can be added if needed, see the PostPbject API docs (linked above)
* for details.
*/
function hook_s3fs_cors_sign_request_options_alter(&$options) {
// Make all files uploaded to your bucket through CORS private.
// This will break most typical access to said files, so only do this if you're sure
// its what you want.
$options['acl'] = "private";
}
Functions
Name![]() |
Description |
---|---|
hook_s3fs_cors_sign_request_options_alter | Alters the options used when writing a file to the bucket using the CORS widget. To learn the valid values for these options, you'll need to be familiar with the PostObject class from the AWS SDK for… |