permission($radice,$_GET["codice"],$id_modulo) && $_SESSION["utente"]->permission($cmd_info["modulo_riferimento"])) { $elenco = AlboCommissione::init($_GET["codice"]); if (!empty($elenco)) { $busta = $elenco->getBusta($_GET["codice_partecipante"],$_GET["codice_richiesta"],true); if (!empty($busta)) { if ($_GET["openP7M"] == "S") { $path = $config["chunk_folder"] . "/" . $_SESSION["utente"]->codice; if (!is_dir($path)) { mkdir($path); } $path .= "/" . $busta["nomeFile"]; file_put_contents($path, $busta["content"]); $busta["content"] = ""; if (file_exists($path)) { $p7m = new P7Manager($path); if ($p7m != false) { $busta["content"] = $p7m->extract(); $file_info = new finfo(FILEINFO_MIME_TYPE); $mime_type = $file_info->buffer($busta["content"]); $busta["nomeFile"] = str_replace(".p7m", "", $busta["nomeFile"]); $busta["mime"] = $mime_type; } unlink($path); } } if(!empty($busta["content"])) { $elenco->addToLog("DOWNLOAD","Partecipante #{$_GET["codice_partecipante"]} - Richiesta #{$_GET["codice_richiesta"]} - {$busta["nomeFile"]}"); header('Content-Description: File Transfer'); header('Content-Disposition: attachment; filename=' . $busta["nomeFile"]); header('Content-Type: ' . $busta["mime"]); header('Content-Transfer-Encoding: binary'); header('Connection: Keep-Alive'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); echo $busta["content"]; $error = false; } } } } if ($error) { header('HTTP/1.0 403 Forbidden'); die(); } ?>