<?php
    
	if(!$dprotect) die ('Access Denied!');
		
        if(is_numeric($link[1]) && $fileDetails = $core->fileDetailsForId($link[1])) {
            $file = $config['filedir'].'/'.$fileDetails['filename'];
            if(file_exists($file)) {
                $ext = $core->extension($fileDetails['filename']);
                header('Content-Description: File Transfer');
                header('Content-Type: application/octet-stream');
                header('Content-Disposition: attachment; filename='.$core->check($fileDetails['filetitle'], 'flink').'.'.$ext);
                header('Content-Transfer-Encoding: binary');
                header('Expires: 0');
                header('Cache-Control: must-revalidate');
                header('Pragma: public');
                header('Content-Length: ' . filesize($file));
                ob_clean();
                flush();
                readfile($file);
                exit();
            }
        }
	
?>