gestione gare pubbliche
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.
 
 
 
 
 

53 righe
1.4 KiB

<?
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php";
include_once($configPath);
if (! empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice) && ! empty($_GET["token"])) {
session_write_close();
if(! empty($_SESSION["ARCHIVIO-DOCUMENTALE"][$_GET["token"]])) {
$result = $pdo->go($_SESSION["ARCHIVIO-DOCUMENTALE"][$_GET["token"]]["sql"], $_SESSION["ARCHIVIO-DOCUMENTALE"][$_GET["token"]]["bind"]);
if($result->rowCount() > 0) {
ini_set("max_execution_time", "600");
ini_set("memory_limit", "1024M");
$path = "{$config["chunk_folder"]}/{$_GET["token"]}.zip";
$zip = new ZipArchive;
if ($zip->open("{$path}", ZipArchive::CREATE) === TRUE) {
while ($record = $result->fetch(PDO::FETCH_ASSOC)) {
$file = filesManager::getFilePathFromAttachmentRecord($record);
if(file_exists($file)) {
$zip->addFile($file, "{$record["codice"]}-{$record["name"]}");
}
}
$zip->close();
header('Content-Type: application/zip');
header('Content-Length: ' . filesize($path));
header('Content-Disposition: attachment; filename="export-archivio-documentale.zip"');
readfile($path);
unlink($path);
exit;
}
}
}
}
exit;
header('HTTP/1.0 403 Forbidden');
die();
?>