function user_file_download

Same name and namespace in other branches
  1. 6.x drupal-6.x/modules/user/user.module \user_file_download()

Implements hook_file_download().

Ensure that user pictures (avatars) are always downloadable.

Archivo

drupal-7.x/modules/user/user.module, line 880
Enables the user registration and login system.

Código

function user_file_download($uri) {
  if (strpos(file_uri_target($uri), variable_get('user_picture_path', 'pictures') . '/picture-') === 0) {
    $info = image_get_info($uri);
    return array('Content-Type' => $info['mime_type']);
  }
}