@@ -71,13 +71,13 @@ |
||
| 71 | 71 | if ($form->getClickedButton() && $form->getClickedButton()->getName() === 'download') { |
| 72 | 72 | $bufferSize = 1024 * 50; |
| 73 | 73 | $response = new StreamedResponse(); |
| 74 | - $response->headers->set('Content-Length',filesize($logFile)); |
|
| 75 | - $response->headers->set('Content-Disposition','attachment; filename=' . basename($logFile)); |
|
| 76 | - $response->headers->set('Content-Type','application/octet-stream'); |
|
| 77 | - $response->setCallback(function() use($logFile,$bufferSize) { |
|
| 78 | - if ($fh = fopen($logFile,'r')) { |
|
| 74 | + $response->headers->set('Content-Length', filesize($logFile)); |
|
| 75 | + $response->headers->set('Content-Disposition', 'attachment; filename='.basename($logFile)); |
|
| 76 | + $response->headers->set('Content-Type', 'application/octet-stream'); |
|
| 77 | + $response->setCallback(function () use($logFile, $bufferSize) { |
|
| 78 | + if ($fh = fopen($logFile, 'r')) { |
|
| 79 | 79 | while (!feof($fh)) { |
| 80 | - echo fread($fh,$bufferSize); |
|
| 80 | + echo fread($fh, $bufferSize); |
|
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | }); |