(packet capture) stream/flush output to browser, closes https://github.com/opnsense/core/issues/1116

This commit is contained in:
Ad Schellevis 2016-08-05 19:37:39 +02:00
parent 0dca6edd34
commit 6e06097709

View File

@ -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