hook_filemanager_download

Definition

hook_filemanager_download($file)
filemanager/doc/filemanager.php, line 58

Description

Determine whether this private download is accessible by the user.

When a private file is requested the file api will call all modules passing them the file. The first module to respond will be authoritative and no further modules will be queried.

The file api will default access to FALSE, except for general where it will be TRUE, if no modules return a value.

This hook should not return anything or one of three values:

  • No Return - indicates this module does not know about this file
  • FALSE - Indicates this user should be denied access.
  • TRUE - Indicates this user should be given access.
  • Array - This array contains headers that will given to the client

Related topics

Namesort iconDescription
HooksAllow modules to interact with the Drupal core.

Code

<?php
function hook_filemanager_download($file) {
  if ($file->area == 'myarea') {
    return TRUE;
  }
}
?>