// .../download.php/file/123/foo.tar.gz
// 123 -> file_id
// foo.tar.gz ignored
+
$file_id = $expl_pathinfo[4];
+
+ // Allow alternate content-type rendering by hook
+ $default_content_type = 'application/binary';
+
+ $script = 'frs_download_file';
+ $content_type = util_negociate_alternate_content_types($script, $default_content_type);
+
+ if($content_type != $default_content_type) {
+ $hook_params = array();
+ $hook_params['accept'] = $content_type;
+ $hook_params['group_id'] = $group_id;
+ $hook_params['file_id'] = $file_id;
+ $hook_params['return'] = '';
+ $hook_params['content_type'] = '';
+ plugin_hook_by_reference('content_negociated_frs_download_file', $hook_params);
+ if($hook_params['content_type'] != ''){
+ header('Content-type: '. $hook_params['content_type']);
+ echo $hook_params['content'];
+ }
+ else {
+ header('HTTP/1.1 406 Not Acceptable',true,406);
+ }
+ exit(0);
+ }
+
$File = frsfile_get_object($file_id);
if (!$File) {
session_redirect404();