[-] FO: Fix #PSCFV-9057 close output buffer before sending attachment and virtualproducts

This commit is contained in:
Rémi Gaillard
2013-05-14 18:13:07 +02:00
parent 2bcd5bd0c2
commit f33e8d8b4a
2 changed files with 6 additions and 1 deletions
+3 -1
View File
@@ -270,12 +270,14 @@ class GetFileControllerCore extends FrontController
$mimeType = 'application/octet-stream';
}
if (ob_get_level())
ob_end_clean();
/* Set headers for download */
header('Content-Transfer-Encoding: binary');
header('Content-Type: '.$mimeType);
header('Content-Length: '.filesize($file));
header('Content-Disposition: attachment; filename="'.$filename.'"');
ob_end_flush();
$fp = fopen($file, 'rb');
while (!feof($fp))
echo fgets($fp, 16384);