From 2e77ac243bf4f910fb367f71186470e00b2fac43 Mon Sep 17 00:00:00 2001 From: Grisu Date: Sun, 4 Dec 2022 23:04:29 +0100 Subject: [PATCH] added compression for download and ensure utf-8 encoding --- app/public/download_table.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/public/download_table.php b/app/public/download_table.php index 45dcb23..cdd834e 100644 --- a/app/public/download_table.php +++ b/app/public/download_table.php @@ -9,7 +9,8 @@ $table = $_GET['table']; } - header('Content-type: text/csv'); + ob_start('ob_gzhandler'); #compressing data which is sent to the browser, the browser will decompress the data automatically + header('Content-type: text/csv; charset="UTF-8" '); header('Content-Disposition: attachment; filename="table.csv" '); function download_table($stmt) {