[BUGFIX] CSV-Download not working in IE and HTTPS backend 02/20902/4
authorWouter Wolters <typo3@wouterwolters.nl>
Sat, 18 May 2013 19:22:16 +0000 (21:22 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 8 Feb 2014 18:34:13 +0000 (19:34 +0100)
When using a HTTPS backend the download of CSV is not
working in Internet Explorer browser versions lower then 9.
Add the needed header to fix this problem.

Change-Id: Iefa63fb37d57491fb73bfd504b6caed5b76c8cac
Resolves: #16491
Releases: 6.2, 6.1, 6.0, 4.7, 4.5
Reviewed-on: https://review.typo3.org/20902
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php

index c8f1322..8d6506c 100644 (file)
@@ -1581,9 +1581,11 @@ class DatabaseRecordList extends \TYPO3\CMS\Recordlist\RecordList\AbstractDataba
                // Setting filename:
                $filename = $prefix . '_' . date('dmy-Hi') . '.csv';
                // Creating output header:
-               $mimeType = 'application/octet-stream';
-               header('Content-Type: ' . $mimeType);
+               header('Content-Type: application/octet-stream');
                header('Content-Disposition: attachment; filename=' . $filename);
+               // Cache-Control header is needed here to solve an issue with browser IE and
+               // versions lower then 9. See for more information: http://support.microsoft.com/kb/323308
+               header("Cache-Control: ''");
                // Printing the content of the CSV lines:
                echo implode(chr(13) . chr(10), $this->csvLines);
                // Exits: