Write debug log to tempDir, redirect + download w/ readfile()

This commit is contained in:
billz
2023-10-31 20:31:27 +00:00
parent e99e98d8ca
commit 97a9cac5e8
3 changed files with 40 additions and 3 deletions

View File

@@ -0,0 +1,21 @@
<?php
require '../../includes/csrf.php';
$filePath = $_GET['filePath'];
$filename = "raspap_debug.log";
if (isset($filePath) && strpos($filePath, $filename) !== false) {
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($filePath));
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: '.filesize($filePath));
readfile($filePath);
exit();
} else {
header('Location: '.'/system_info');
exit();
}