function user_file_download

user_file_download($uri)

Implements hook_file_download().

Ensure that user pictures (avatars) are always downloadable.

File

modules/user/user.module, line 906
Enables the user registration and login system.

Code

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']);
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!user!user.module/function/user_file_download/7.x