raspap-webgui-mirror/ajax/system/sys_get_logfile.php

24 lines
689 B
PHP
Raw Normal View History

<?php
require '../../includes/csrf.php';
2023-10-31 22:18:23 +00:00
require_once '../../includes/config.php';
require_once '../../src/RaspAP/Auth/HTTPAuth.php';
require_once '../../includes/authenticate.php';
2023-12-31 08:03:19 +00:00
$tempDir = sys_get_temp_dir();
$filePath = $tempDir . DIRECTORY_SEPARATOR . RASPI_DEBUG_LOG;
2023-12-31 08:03:19 +00:00
if (isset($filePath)) {
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();
}