aboutsummaryrefslogtreecommitdiff
path: root/app/views/importExport/sqlite.phtml
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2024-10-23 21:55:52 +0200
committerGravatar GitHub <noreply@github.com> 2024-10-23 21:55:52 +0200
commit7a5ce0fe20d63746b7f5b435ba5eef0a9b7db2d6 (patch)
tree090cff8c9852ecc4636feaa1c5a75304c23fad27 /app/views/importExport/sqlite.phtml
parent60dd22d3b3916f5113954fc1472b1658c3c4245f (diff)
Web export SQLite (#6931)
* Web export SQLite https://github.com/FreshRSS/FreshRSS/discussions/6930 * Implement download * Fix operator precedence * Set Last-Modified * Sort by time, newest first * Fix Last-Modified * Use DateTimeInterface::RFC7231 * Add not_applicable message
Diffstat (limited to 'app/views/importExport/sqlite.phtml')
-rw-r--r--app/views/importExport/sqlite.phtml9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/views/importExport/sqlite.phtml b/app/views/importExport/sqlite.phtml
new file mode 100644
index 000000000..8c9adcab1
--- /dev/null
+++ b/app/views/importExport/sqlite.phtml
@@ -0,0 +1,9 @@
+<?php
+declare(strict_types=1);
+/** @var FreshRSS_View $this */
+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);