getMessage()); } $path = $release["package_path"]; $size = filesize($path); $handle = fopen($path, "rb"); if ($size === false || $handle === false) { manageApiFail(500, "Release-Paket konnte nicht geöffnet werden."); } manageInstanceTouch($instance["id"], []); manageLogAccess("Package downloaded", [ "instance" => $instance["id"], "version" => $version, ]); header("Content-Type: application/zip"); header("Content-Disposition: attachment; filename=\"" . addcslashes(basename($path), "\"\\") . "\""); header("Content-Length: " . (string) $size); // Private: the response is tied to an authenticated instance, so no shared // cache may keep a copy. header("Cache-Control: private, no-store"); header("X-Content-Type-Options: nosniff"); fpassthru($handle); fclose($handle);