[BUGFIX] Improve jumpUrl download of large files 18/21918/2
authorTill Busch <buti@bux.at>
Thu, 11 Oct 2012 13:22:48 +0000 (15:22 +0200)
committerSteffen Ritter <info@rs-websystems.de>
Fri, 5 Jul 2013 10:11:11 +0000 (12:11 +0200)
* Prevent output-buffering
* Add Content-Length header

Fixes: #41718
Releases: 6.2, 6.1, 6.0
Change-Id: I8a1a33dc4337a5947bafbad980b73343be637da7
Reviewed-on: https://review.typo3.org/21918
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

index dba11af..1b420a6 100644 (file)
@@ -2885,6 +2885,8 @@ class TypoScriptFrontendController {
                                                                header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
                                                                header('Content-Type: ' . $mimeType);
                                                                header('Content-Disposition: attachment; filename="' . basename($absoluteFileName) . '"');
+                                                               header('Content-Length: ' . filesize($absoluteFileName));
+                                                               \TYPO3\CMS\Core\Utility\GeneralUtility::flushOutputBuffers();
                                                                readfile($absoluteFileName);
                                                                die;
                                                        } else {