gerarchia < 100 && tokenVerify($_POST["token"])) { if (!empty($_POST["filechunk"])) { if (strpos($_POST["filechunk"], "../")===false) { $chunkPath = $config["chunk_folder"]."/".$_SESSION["utente"]->codice."/".$_POST["filechunk"]; $dgue = DGUE::getDGUEFromXML(file_get_contents($chunkPath)); if (!empty($dgue)) { $error = false; $html = DGUE::showDGUE($dgue,[],$_POST["version"] ?? null); $html = mb_convert_encoding($html, 'HTML-ENTITIES', "UTF-8"); $content = documentConverter::getPDFWithTCPDF($html,"A4","portrait",true,true); $fileName = 'DGUE.pdf'; if (!empty($content)) { $error = false; header("Content-type:application/pdf"); header("Content-Disposition:attachment;filename={$fileName}"); echo $content; } } } } } if ($error) { header('HTTP/1.0 403 Forbidden'); ?>