diff --git a/vilesci/statistik/statistik_sql.php b/vilesci/statistik/statistik_sql.php index fb27ebe3a..0a8173c37 100644 --- a/vilesci/statistik/statistik_sql.php +++ b/vilesci/statistik/statistik_sql.php @@ -113,11 +113,18 @@ switch ($outputformat) echo $html; break; case 'csv': + header("Content-type: text/csv"); + header("Content-Disposition: attachment; filename=data.csv"); + header("Pragma: no-cache"); + header("Expires: 0"); echo $csv; break; case 'json': + header("Content-type: application/json"); + header("Content-Disposition: attachment; filename=data.json"); + header("Pragma: no-cache"); + header("Expires: 0"); //$array= array_map("str_getcsv",explode("\n", $csv)); - echo json_encode($json); } ?>