mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 01:24:38 +00:00
(packet capture) stream/flush output to browser, closes https://github.com/opnsense/core/issues/1116
This commit is contained in:
parent
0dca6edd34
commit
6e06097709
@ -154,7 +154,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
header("Content-Type: application/octet-stream");
|
||||
header("Content-Disposition: attachment; filename=packetcapture.cap");
|
||||
header("Content-Length: ".filesize("/root/packetcapture.cap"));
|
||||
readfile("/root/packetcapture.cap");
|
||||
$file = fopen("/root/packetcapture.cap", "r");
|
||||
while(!feof($file)) {
|
||||
print(fread($file, 32 * 1024));
|
||||
ob_flush();
|
||||
}
|
||||
fclose($file);
|
||||
exit;
|
||||
} elseif (!empty($_GET['view'])) {
|
||||
// download capture contents
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user