From b43a8f48fbec382bb664b4098f9588a1e3206866 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Mon, 13 Dec 2010 15:37:59 +0800 Subject: [PATCH] GnumericToExcel.php --- GnumericToExcel.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GnumericToExcel.php b/GnumericToExcel.php index 38d96402..f53c8bcf 100644 --- a/GnumericToExcel.php +++ b/GnumericToExcel.php @@ -90,10 +90,11 @@ class Pman_Core_GnumericToExcel extends Pman } // unlink($srcTmp); $fname .= preg_match('/\.xls/i', $fname) ? '' : '.xls'; // make sure it ends in xls.. - $fh = fopen($targetTmp, 'r'); + header('Content-type: application/vnd.ms-excel'); header('Content-Disposition: attachment; filename="' .addslashes($fname). '"'); header('Content-length: '. filesize($targetTmp)); + $fh = fopen($targetTmp, 'r'); // will not work on IE... - needs while/fget.. fpassthru($fh); unlink($targetTmp); -- 2.39.2