fix: [api] close the file after reading it

pull/3729/head
iglocska 2018-09-29 23:42:21 +02:00
parent 24c2a7f8a2
commit bef609607a
1 changed files with 1 additions and 0 deletions

View File

@ -2184,6 +2184,7 @@ class AttributesController extends AppController
fwrite($tmpfile, $exportTool->footer($exportToolParams));
fseek($tmpfile, 0);
$final = fread($tmpfile, fstat($tmpfile)['size']);
fclose($tmpfile);
$responseType = $validFormats[$returnFormat][0];
return $this->RestResponse->viewData($final, $responseType, false, true);
}