Skip to content

Commit b8a54f0

Browse files
authored
Fix: Issue with XLSX file download (#289)
1 parent 84f7a38 commit b8a54f0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Controller/Admin/CustomersController.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,13 +281,16 @@ public function downloadFinishedExportAction(Request $request)
281281
$exporter->getExtension()
282282
);
283283

284+
$content = $exporter->generateExportFile($exportData);
285+
$contentSize = strlen($content);
286+
284287
$response = new Response();
285288
$response
286-
->setContent($exporter->generateExportFile($exportData))
289+
->setContent($content)
287290
->headers->add(
288291
[
289292
'Content-Type' => $exporter->getMimeType(),
290-
'Content-Length' => $exporter->getFilesize(),
293+
'Content-Length' => $contentSize,
291294
'Content-Disposition' => sprintf('attachment; filename="%s"', $filename),
292295
]
293296
);

0 commit comments

Comments
 (0)