diff --git a/lib/classes/set/export.class.php b/lib/classes/set/export.class.php index 3b056189bc..30fb5efe61 100644 --- a/lib/classes/set/export.class.php +++ b/lib/classes/set/export.class.php @@ -1031,39 +1031,19 @@ class set_export extends set_abstract public static function stream_data($data, $exportname, $mime, $disposition='attachment') { - header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); - header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); - header("Cache-Control: no-store, no-cache, must-revalidate"); - header("Cache-Control: post-check=0, pre-check=0", false); - header("Pragma: public"); - header("Content-Type: " . $mime); - header("Content-Length: " . strlen($data)); - header("Cache-Control: max-age=3600, must-revalidate "); - header("Content-Disposition: " . $disposition . "; filename=" . $exportname . ";"); -echo $data; - exit(); - $response = new \Symfony\Component\HttpFoundation\Response(); - $response->headers->set('Cache-Control', 'must-revalidate, post-check=0, pre-check=0'); - $response->setLastModified(new DateTime()); - $response->headers->set('Pragma', 'public', true); - $response->headers->set('Content-Type', $mime); - $response->headers->set('Content-Length', strlen($data)); - $response->headers->set('Content-Disposition', $disposition. "; filename=" . $exportname . ";"); -// header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); -// header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); -// header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); -// -// header("Pragma: public"); -// -// header("Content-Type: " . $mime); -// header("Content-Length: " . strlen($data)); -// header("Cache-Control: max-age=3600, must-revalidate "); -// header("Content-Disposition: " . $disposition -// . "; filename=" . $exportname . ";"); -// -// echo $data; - $response->send(); -exit(); + header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); + header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); + header("Cache-Control: no-store, no-cache, must-revalidate"); + header("Cache-Control: post-check=0, pre-check=0", false); + header("Pragma: no-cache"); + header("Content-Type: " . $mime); + header("Content-Length: " . strlen($data)); + header("Cache-Control: max-age=3600, must-revalidate "); + header("Content-Disposition: " . $disposition + . "; filename=" . $exportname . ";"); + + echo $data; + return true; }