[horde] mime attachment recognition
jason kawaja
kawaja at ece.ufl.edu
Fri Feb 15 06:09:29 PST 2002
On Fri, 15 Feb 2002, Chuck Hagenbuch wrote:
> Quoting Jan Schneider <jan at horde.org>:
>
> > That's not possible. But you can try to patch the MIME::getType()
> > function to retrieve the mime type from the file extension instead.
> > Good luck.
>
> That's what MIME_Magic is for....
i have added the following to imp/view.php under view_attach :
$fname = MIME::decode($mime->name);
$tmp = explode(".", $fname);
$ext = $tmp[1];
if ($ext == 'doc') { $mime_type = 'application/msword'; }
if ($ext == 'xls') { $mime_type = 'application/msexcel'; }
if ($ext == 'ppt') { $mime_type = 'application/mspowerpoint'; }
works as expected...so far; i'm just now learning php.
/* Regards,
Jason Kawaja, UF-ECE Sys Admin */
9:05am up 63 day(s), 14:59, 1 user, load average: 0.02, 0.04, 0.05
More information about the horde
mailing list