You are here

function hook_file_transfer in File Entity (fieldable files) 7.3

Same name and namespace in other branches
  1. 8.2 file_entity.api.php \hook_file_transfer()
  2. 7.2 file_entity.api.php \hook_file_transfer()

React to a file being downloaded.

1 invocation of hook_file_transfer()
file_entity_download_page in ./file_entity.pages.inc
Menu callback; download a single file entity.

File

./file_entity.api.php, line 344
Hooks provided by the File Entity 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);
  }
}