function commerce_file_get_content_headers in Commerce File 7
Returns appropriate content headers for download
Parameters
$file: A file object
Return value
An associative array of headers, as expected by file_transfer()
1 call to commerce_file_get_content_headers()
- commerce_file_file_download in ./
commerce_file.module - Implements hook_file_download().
File
- ./
commerce_file.module, line 816 - Provides integration of file licenses with Commerce
Code
function commerce_file_get_content_headers($file) {
// Set special header to detect on hook_exit()
$headers = array(
COMMERCE_FILE_HEADER_NAME => 1,
);
// merge default private file headerss
$headers += file_get_content_headers($file);
// Allow other modules to alter the returned headers.
drupal_alter('commerce_file_content_headers', $headers, $file);
return $headers;
}