checkAdminPermission("OPEN")) { if (!empty($_GET["codice_richiesta"])) { $richiesta = $manager->getRichieste("S",["codice"=>$_GET["codice_richiesta"]]); if (!empty($richiesta)) { $richiesta = $richiesta[0]; if (empty($richiesta["apertura"]) || (strtotime($richiesta["apertura"]) < time())) { $integrazione = $manager->getContent($_GET["codice_richiesta"],$_GET["codice"],true); if (!empty($integrazione["content"])) { adaptMemoryLimitToFile($integrazione["file"]); } } } } } } if ($integrazione["content"] !== false) { if (strpos($integrazione["nomeFile"],".") === false) { $ext = getTypeAndExtension($integrazione["content"],true); $integrazione["nomeFile"] = "Risposta{$integrazione["codice"]}.{$ext["ext"]}"; } header('Content-Description: File Transfer'); header('Content-Type: ' . $integrazione["mime"]); header('Content-Disposition: attachment; filename='.str_replace("-",".",$integrazione["nomeFile"])); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); echo $integrazione["content"]; } else { header('HTTP/1.0 403 Forbidden'); echo "

FORBIDDEN

"; die(); } ?>