function user_file_download in Drupal 5
Same name and namespace in other branches
- 4 modules/user.module \user_file_download()
- 6 modules/user/user.module \user_file_download()
- 7 modules/user/user.module \user_file_download()
Implementation of hook_file_download().
Ensure that user pictures (avatars) are always downloadable.
File
- modules/
user/ user.module, line 433 - Enables the user registration and login system.
Code
function user_file_download($file) {
if (strpos($file, variable_get('user_picture_path', 'pictures') . '/picture-') === 0) {
$info = image_get_info(file_create_path($file));
return array(
'Content-type: ' . $info['mime_type'],
);
}
}