function elfinder_file_download in elFinder file manager 7.2
Same name and namespace in other branches
- 8.2 elfinder.module \elfinder_file_download()
- 6.2 elfinder.module \elfinder_file_download()
- 7.3 elfinder.module \elfinder_file_download()
File
- ./
elfinder.module, line 1260
Code
function elfinder_file_download($uri) {
if (variable_get('elfinder_settings_filesystem_handleprivate', 'true') == 'true') {
global $user;
$accessown = 'download own uploaded files';
$accessall = 'download all uploaded files';
$info = elfinder_get_drupal_file_obj($uri);
if ($info->uid == $user->uid && user_access($accessown) || user_access($accessall)) {
$disposition = preg_match("/^(text|image)\\//", $info->filemime) ? 'inline' : 'attachment';
return array(
'Content-Type' => $info->filemime,
'Content-Length' => $info->filesize,
'Content-Disposition' => elFinderDrupal::GetContentDisposition($info->filename, $info->filemime, FALSE),
);
}
return NULL;
}
}