Non puoi selezionare più di 25 argomenti
Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
43 righe
1.2 KiB
43 righe
1.2 KiB
<? |
|
|
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
|
|
$content = false; |
|
$error = true; |
|
if (!empty($_GET['codice']) && !empty($_SESSION["utente"]->oe) && !$_SESSION["utente"]->isSupporto() && tokenVerify($_GET["token"])) { |
|
|
|
$managerRisposta = publicRispostaDocumentale::init($_GET['codice']); |
|
|
|
if(!empty($managerRisposta)){ |
|
$error = false; |
|
|
|
$file = $managerRisposta->getFile(); |
|
|
|
if(!empty($file['dir']) && !empty($file['file'])){ |
|
adaptMemoryLimitToFile($file["file"]); |
|
$content = simple_decrypt(file_get_contents($file["file"]),base64_decode($file["content"])); |
|
} |
|
|
|
if (!empty($content)) { |
|
header('Content-Description: File Transfer'); |
|
header('Content-Type: ' . $file["mime"]); |
|
header('Content-Disposition: attachment; filename='.str_replace("-",".",$file["nomeFile"])); |
|
header('Content-Transfer-Encoding: binary'); |
|
header('Expires: 0'); |
|
header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); |
|
header('Pragma: public'); |
|
echo $content; |
|
}else { |
|
$error = true; |
|
} |
|
} |
|
|
|
} |
|
|
|
if($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |
|
|
|
?>
|
|
|