projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b43a8f4
)
GnumericToExcel.php
author
Alan Knowles
<alan@akbkhome.com>
Mon, 13 Dec 2010 07:39:42 +0000
(15:39 +0800)
committer
Alan Knowles
<alan@akbkhome.com>
Mon, 13 Dec 2010 07:39:42 +0000
(15:39 +0800)
GnumericToExcel.php
patch
|
blob
|
history
diff --git
a/GnumericToExcel.php
b/GnumericToExcel.php
index
f53c8bc
..
76c3ac3
100644
(file)
--- a/
GnumericToExcel.php
+++ b/
GnumericToExcel.php
@@
-93,10
+93,16
@@
class Pman_Core_GnumericToExcel extends Pman
header('Content-type: application/vnd.ms-excel');
header('Content-Disposition: attachment; filename="' .addslashes($fname). '"');
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);
+ header('Content-length: '. filesize($targetTmp));
+ header("Content-Transfer-Encoding: binary");
+ if ($file = fopen($targetTmp, 'rb')) {
+ while(!feof($file) and (connection_status()==0)) {
+ print(fread($file, 1024*8));
+ flush();
+ }
+ fclose($file);
+ }
+
unlink($targetTmp);
exit;
unlink($targetTmp);
exit;