You are here

function hook_file_download_headers_alter in File Entity (fieldable files) 8.2

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

Alter file download headers.

Parameters

array $headers: Array of download headers.

object $file: File object.

1 invocation of hook_file_download_headers_alter()
FileController::download in src/Controller/FileController.php
Returns a HTTP response for a file being downloaded.

File

./file_entity.api.php, line 34
Hooks provided by the File Entity module.

Code

function hook_file_download_headers_alter(array &$headers, $file) {

  // Instead of being powered by PHP, tell the world this resource was powered
  // by your custom module!
  $headers['X-Powered-By'] = 'My Module';
}