break; default: } //Compound file path if ($type == "release" || $type == "external_release") { $fileLocation = $config["homedir"] . "/" . $data["location"]; $short_name = preg_split("/\\//", $data["location"]); $last_name = $short_name[sizeof($short_name) - 1]; } else { if ($type == "file_sharing") { if (!empty($id_attachment)) { require_once $config['homedir'] . "/operation/file_sharing/FileSharingPackage.class.php"; $file = new FileSharingPackage($id_attachment); $fileLocation = $file->getFullpath(); $last_name = $file->getName(); $file->trackingDownload(); $data = $id_attachment; } } else { $fileLocation = $config["homedir"] . "/attachment/" . $data["id_attachment"] . "_" . $data["filename"]; $last_name = $data["filename"]; } } //General check to avoid hacking using wrong id of files if (!$data) { audit_db($config["id_user"], $config["REMOTE_ADDR"], "ACL Violation", "Trying to access Downloads browser"); require $general_error; exit; } session_write_close(); // Allow download file