check if download file can be created

This commit is contained in:
Uwe Steinmann 2020-09-04 14:10:24 +02:00
parent a736d60df5
commit 8ec772c504

View File

@ -46,16 +46,18 @@ class SeedDMS_Controller_TransmittalDownload extends SeedDMS_Controller_Common {
}
}
$filename = tempnam(sys_get_temp_dir(), 'transmittal-download');
$filename = tempnam(sys_get_temp_dir(), 'transmittal-download-');
if($filename) {
$downmgr->createArchive($filename);
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . filesize($filename));
header("Content-Disposition: attachment; filename=\"export-" .date('Y-m-d') . ".zip\"");
header("Content-Type: application/zip");
header("Cache-Control: must-revalidate");
if($downmgr->createArchive($filename)) {
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . filesize($filename));
header("Content-Disposition: attachment; filename=\"export-" .date('Y-m-d') . ".zip\"");
header("Content-Type: application/zip");
header("Cache-Control: must-revalidate");
readfile($filename);
readfile($filename);
} else {
}
unlink($filename);
}
exit;