GnumericToExcel.php
authorAlan Knowles <alan@roojs.com>
Fri, 5 Jun 2020 04:29:00 +0000 (12:29 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 5 Jun 2020 04:29:00 +0000 (12:29 +0800)
GnumericToExcel.php

index a5d0d0b..ce965f7 100644 (file)
@@ -91,7 +91,7 @@ class Pman_Core_GnumericToExcel extends Pman
         $ss = System::which('ssconvert');
         $cmd = $xvfb . " -a " . $ss. 
                 " --import-encoding=Gnumeric_XmlIO:sax" .
         $ss = System::which('ssconvert');
         $cmd = $xvfb . " -a " . $ss. 
                 " --import-encoding=Gnumeric_XmlIO:sax" .
-                " --export-type=Gnumeric_Excel:excel_biff8 " . 
+                " --export-type={$outfmt} " . 
                 $srcTmp . ' ' . $targetTmp . ' 2>&1';
         // echo $cmd;
         //passthru($cmd);exit;
                 $srcTmp . ' ' . $targetTmp . ' 2>&1';
         // echo $cmd;
         //passthru($cmd);exit;
@@ -109,7 +109,7 @@ class Pman_Core_GnumericToExcel extends Pman
         }
         $fname .= preg_match('/\.xls/i', $fname) ? '' :  '.xls'; // make sure it ends in xls..
        
         }
         $fname .= preg_match('/\.xls/i', $fname) ? '' :  '.xls'; // make sure it ends in xls..
        
-        header('Content-type: application/vnd.ms-excel');
+        header('Content-type: ' . $mime);
         header('Content-Disposition: attachment; filename="' .addslashes($fname). '"');
         header('Content-length: '. filesize($targetTmp));   
         header("Content-Transfer-Encoding: binary");
         header('Content-Disposition: attachment; filename="' .addslashes($fname). '"');
         header('Content-length: '. filesize($targetTmp));   
         header("Content-Transfer-Encoding: binary");