0 && (int) ($file["size"] ?? 0) > $maxBytes) { throw new RuntimeException("Backup überschreitet die konfigurierte Maximalgröße."); } if (!manageFileIsZip($tmpName)) { throw new RuntimeException("Die hochgeladene Datei muss ein ZIP-Archiv sein."); } $meta = []; $rawMeta = trim((string) ($_POST["meta"] ?? "")); if ($rawMeta !== "") { $decoded = json_decode($rawMeta, true); if (is_array($decoded)) { $meta = $decoded; } } $result = manageBackupStoreUpload( $instance["id"], $tmpName, (string) ($_POST["filename"] ?? ""), (string) ($_POST["sha256"] ?? ""), $meta, ); manageApiSendJson(200, array_merge(["success" => true, "instance" => $instance["id"]], $result)); } catch (Throwable $exception) { manageLogError("Backup upload rejected", [ "instance" => $instance["id"], "error" => $exception->getMessage(), ]); manageApiFail(400, $exception->getMessage()); }