Define filename (instead of download.csv)

pull/3768/head
Amaury Leroy 2018-10-16 11:32:11 +02:00
parent 35400ef309
commit db782440f2
1 changed files with 3 additions and 1 deletions

View File

@ -2716,6 +2716,8 @@ class EventsController extends AppController
if ($user === false) {
return $exception;
}
$filename = 'misp.csv.event' . $eventid . '.csv';
$final = $this->Event->restSearch($user, 'csv', $filters);
// if it's a search, grab the attributeIDList from the session and get the IDs from it. Use those as the condition
// We don't need to look out for permissions since that's filtered by the search itself
@ -2746,7 +2748,7 @@ class EventsController extends AppController
}
}
$responseType = 'csv';
return $this->RestResponse->viewData($final, $responseType, false, true, 'download.csv');
return $this->RestResponse->viewData($final, $responseType, false, true, $filename);
}
public function _addIOCFile($id)