Files
FreshRSS/app/views/importExport/sqlite.phtml
Alexandre Alapetite 2cc5621860 Ensure no PHP buffer for SQLite download (#7230)
* Ensure no PHP buffer for SQLite download
fix https://github.com/FreshRSS/FreshRSS/pull/6931#issuecomment-2567037406

* No warning if any case
2025-01-16 14:18:34 +01:00

11 lines
490 B
PHTML

<?php
declare(strict_types=1);
/** @var FreshRSS_View $this */
@ob_end_clean(); // Ensure no buffer
header('Content-Type: application/vnd.sqlite3');
header('Content-Disposition: attachment; filename="' . basename($this->sqlitePath) . '"');
header('Cache-Control: private, no-store, max-age=0');
header('Last-Modified: ' . gmdate(DateTimeInterface::RFC7231, @filemtime($this->sqlitePath) ?: 0));
header('Content-Length: ' . (@filesize($this->sqlitePath) ?: 0));
readfile($this->sqlitePath);