1 file_module_test.module file_module_test_file_download($uri)

Implements hook_file_download().

File

core/modules/file/tests/file_module_test/file_module_test.module, line 75
Provides File module pages for testing purposes.

Code

function file_module_test_file_download($uri) {
  if (state_get('file_module_test_grant_download_access')) {
    // Mimic what file_get_content_headers() would do if we had a full $file
    // object to pass to it.
    return array(
      'Content-Type' => mime_header_encode(file_get_mimetype($uri)),
      'Content-Length' => filesize($uri),
      'Cache-Control' => 'private',
    );
  }
}