db(); $inc->file(); if (isset($_GET['admin'])) { $admin = 'true'; } else { $admin = 'false'; } if (isset($_GET['client'])) { $client = 'true'; } else { $client = 'false'; } if (isset($_GET['id'])) { if ($files = $GLOBALS['file']->get($admin, addslashes($_GET['id']), $client)) { header("Pragma: public"); header("Expires: 0"); header("Cache-Control: private"); header('Content-Type: '.$files['type']); header('Content-Length: '.strlen($files['file'])); header('Content-Disposition: attachment; filename='.$files['name']); echo($files['file']); } } else { if (isset($_SESSION['hcl_'.addslashes($_GET['chatid'])]['fileid'])) { if ($files = $GLOBALS['file']->get($admin, $_SESSION['hcl_'.addslashes($_GET['chatid'])]['fileid'], $client)) { header("Pragma: public"); header("Expires: 0"); header("Cache-Control: private"); header('Content-Type: '.$files['type']); header('Content-Length: '.strlen($files['file'])); header('Content-Disposition: attachment; filename='.$files['name']); echo($files['file']); } } } // do events that need to be done at the end of the file $inc->finished(); ?>