1 file.api.php | hook_file_transfer($uri, array $headers) |
React to a file being downloaded.
File
- core/
modules/ file/ file.api.php, line 415 - Hooks for file module.
Code
function hook_file_transfer($uri, array $headers) {
// Redirect a download for an S3 file to the actual location.
if (file_uri_scheme($uri) == 's3') {
$url = file_create_url($uri);
drupal_goto($url);
}
}