[horde] MS-Excel MIME Viewer

Dominic Ijichi dom at ijichi.org
Wed Jun 26 10:12:33 PDT 2002


Hi,  this doesn't work out of the box for me using xlhtml v0.5, for RELENG and
HEAD.  I also applied the 'fix' for the msword viewer that was posted recently
to get inline images working which worked a treat.  Also, I can't get the
x-extension mappings working which would be really nice - a lot of browsers
don't seem to set mime types properly.  I did the following to get msexcel to
work (I guess only the -nh switch is really necessary for xlhtml, the others are
optimum/pretty switches):

--- msexcel.php Wed Jun 26 18:06:24 2002
+++ msexcel.php.~1.8.~  Wed May  8 06:14:21 2002
@@ -34,20 +34,20 @@
         fclose($fh);
 
         $data = '';
-        $pipe = popen($mime_drivers['horde']['msexcel']['location'] . " -a -c
-nh -te $tmp_xls 2>&1", 'r');
+        $pipe = popen($mime_drivers['horde']['msexcel']['location'] . "
$tmp_xls 2>&1", 'r');
         while (($rc = fgets($pipe, 8192))) {
             $data .= $rc;
         }
+
         pclose($pipe);
         unlink($tmp_xls);
 
         /* Strip out the extraneous HTML from xlHtml, and output it.
          * TODO: figure out why this doesn't work with preg_replace! - avsm */
-/*        $res_arr = preg_split('/\<\/?BODY.*\>/', $data);
+        $res_arr = preg_split('/\<\/?BODY.*\>/', $data);
         if (sizeof($res_arr) == 3) {
             return '<pre>' . $res_arr[1] . '</pre>';
-        } */
-       return $data;
+        }
     }
 
     function getType()


------------------------------------------
This message was penned by the hand of Dom


More information about the horde mailing list