Upload via GUI (258 Dateien)
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../includes/bootstrap.php';
|
||||
$staff = require_admin();
|
||||
|
||||
$zipName = $_SESSION['update_zip'] ?? '';
|
||||
if (!$zipName || !preg_match('/^deskhub-update-[\w\.\-]+\.zip$/', $zipName)) {
|
||||
http_response_code(400); die('Kein Update-ZIP vorhanden.');
|
||||
}
|
||||
|
||||
$zipPath = realpath(__DIR__ . '/../downloads') . '/' . $zipName;
|
||||
if (!file_exists($zipPath)) {
|
||||
http_response_code(404); die('Datei nicht gefunden.');
|
||||
}
|
||||
|
||||
header('Content-Type: application/zip');
|
||||
header('Content-Disposition: attachment; filename="' . $zipName . '"');
|
||||
header('Content-Length: ' . filesize($zipPath));
|
||||
header('Cache-Control: private, no-cache');
|
||||
readfile($zipPath);
|
||||
|
||||
// Nach Download aufräumen
|
||||
unlink($zipPath);
|
||||
unset($_SESSION['update_zip'], $_SESSION['update_version'], $_SESSION['update_backup']);
|
||||
exit;
|
||||
Reference in New Issue
Block a user