mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 00:54:41 +00:00
Interfaces: Diagnostics: Packet Capture - make sure output buffering is disabled and add headers for the download. closes https://github.com/opnsense/core/issues/6321
This commit is contained in:
parent
3725d70732
commit
651edfe7c4
@ -156,6 +156,11 @@ class PacketCaptureController extends ApiMutableModelControllerBase
|
||||
if (!empty($payload) && !empty($payload['filename'])) {
|
||||
$this->response->setContentType('application/octet-stream');
|
||||
$this->response->setRawHeader("Content-Disposition: attachment; filename=" . basename($payload['filename']));
|
||||
$this->response->setRawHeader("Content-length: " . filesize($payload['filename']));
|
||||
$this->response->setRawHeader("Pragma: no-cache");
|
||||
$this->response->setRawHeader("Expires: 0");
|
||||
ob_clean();
|
||||
flush();
|
||||
readfile($payload['filename']);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user