Commit a0e9f738 authored by Ad Schellevis's avatar Ad Schellevis

fix Content-Disposition for chrome in captive portal and network insight

parent 6b39cd2e
...@@ -105,12 +105,8 @@ class ServiceController extends ApiControllerBase ...@@ -105,12 +105,8 @@ class ServiceController extends ApiControllerBase
$result = json_decode($response, true); $result = json_decode($response, true);
if ($result != null) { if ($result != null) {
$response = $result['payload']; $response = $result['payload'];
$this->response->setContentType('application/octet-stream', 'UTF-8'); $this->response->setRawHeader("Content-Type: application/octet-stream");
$this->response->setHeader( $this->response->setRawHeader("Content-Disposition: attachment; filename=template_".$templateFileId.".zip");
'Content-Disposition:',
"Attachment; filename=\"template_" . $templateFileId . ".zip\""
);
$this->response->setHeader('Content-Type:', 'application/zip');
return base64_decode($response); return base64_decode($response);
} else { } else {
// return empty response on error // return empty response on error
......
...@@ -259,11 +259,8 @@ class NetworkinsightController extends ApiControllerBase ...@@ -259,11 +259,8 @@ class NetworkinsightController extends ApiControllerBase
$to_date = null, $to_date = null,
$resolution = null $resolution = null
) { ) {
$this->response->setContentType('application/CSV', 'UTF-8'); $this->response->setRawHeader("Content-Type: application/octet-stream");
$this->response->setHeader( $this->response->setRawHeader("Content-Disposition: attachment; filename=".$provider.".csv");
'Content-Disposition:',
"Attachment; filename=\"" . $provider . ".csv\""
);
if ($this->request->isGet()) { if ($this->request->isGet()) {
$backend = new Backend(); $backend = new Backend();
$configd_cmd = "netflow aggregate export {$provider} {$from_date} {$to_date} {$resolution}"; $configd_cmd = "netflow aggregate export {$provider} {$from_date} {$to_date} {$resolution}";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment