function imce_file_download in IMCE 8
Same name and namespace in other branches
- 8.2 imce.module \imce_file_download()
- 5 imce.module \imce_file_download()
- 6.2 imce.module \imce_file_download()
- 6 imce.module \imce_file_download()
- 7 imce.module \imce_file_download()
Implements hook_file_download().
File
- ./
imce.module, line 43 - Defines Drupal hooks for imce module.
Code
function imce_file_download($uri) {
if (Imce::accessFileUri($uri, \Drupal::currentUser())) {
return [
'Content-type' => \Drupal::service('file.mime_type.guesser')
->guess($uri),
'Content-Length' => filesize($uri),
];
}
}