[BUGFIX] CSV-Download not working in IE and HTTPS backend 81/27481/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Sat, 8 Feb 2014 18:48:00 +0000 (19:48 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 8 Feb 2014 18:51:55 +0000 (19:51 +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/27481
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/class.db_list_extra.inc

index bfe258f..2772bfe 100644 (file)
@@ -1875,10 +1875,12 @@ class localRecordList extends recordList {
                        // Setting filename:
                $filename=$prefix.'_'.date('dmy-Hi').'.csv';
 
-                       // Creating output header:
-               $mimeType = 'application/octet-stream';
-               Header('Content-Type: '.$mimeType);
-               Header('Content-Disposition: attachment; filename='.$filename);
+               // Creating output header:
+               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);