'Mon, 26 Jul 1997 05:00:00 GMT', 'Last-Modified' => gmdate('D, d M Y H:i:s'). ' GMT', 'Cache-Control' => 'no-store, no-cache, must-revalidate', 'Cache-Control' => 'post-check=0, pre-check=0', 'Pragma' => 'no-cache', 'Cache-Control' => 'max-age=3600, must-revalidate', 'Content-Disposition' => 'max-age=3600, must-revalidate', ], $headers )); $this->headers->set('Content-Type', 'text/csv'); $this->headers->set('Content-Disposition', $this->headers->makeDisposition( ResponseHeaderBag::DISPOSITION_ATTACHMENT, $filename, // ascii filename fallback false === preg_match('/^[\x20-\x7e]*$/', $filename) ? '' : preg_replace('/[^(x20-x7F)]*$/', '', $filename) )); } }