2 * Implements hook_file_download().
4 function {{ machine_name }}_file_download($uri) {
5 // Check if the file is controlled by the current module.
6 if (!file_prepare_directory($uri)) {
9 if (strpos(file_uri_target($uri), variable_get('user_picture_path', 'pictures') . '/picture-') === 0) {
10 if (!user_access('access user profiles')) {
11 // Access to the file is denied.
15 $info = image_get_info($uri);
16 return array('Content-Type' => $info['mime_type']);