diff --git a/src/Csv.php b/src/Csv.php index a4062f6..13f165f 100644 --- a/src/Csv.php +++ b/src/Csv.php @@ -455,7 +455,10 @@ class Csv { $flat_string = $this->unparse($data, $fields, null, null, $delimiter); if (!is_null($filename)) { - header('Content-type: application/csv'); + $mime = $delimiter === "\t" ? + 'text/tab-separated-values' : + 'application/csv'; + header('Content-type: ' . $mime); header('Content-Length: ' . strlen($flat_string)); header('Cache-Control: no-cache, must-revalidate'); header('Pragma: no-cache');