You are here

function imageblock_file_download in Image Block 7

Implements hook_file_download().

Ensure that image block images are always downloadable. We may want to restrict this in the future.

File

./imageblock.module, line 59
imageblock.module Primarily Drupal hooks.

Code

function imageblock_file_download($uri) {
  if (strpos(file_uri_target($uri), variable_get('imageblock_image_path', 'imageblock')) === 0) {
    $info = image_get_info($uri);
    return array(
      'Content-Type' => $info['mime_type'],
    );
  }
}