[imp] I.E. 6, Word and Mime-type
hofsteda at ucrwcu.rwc.uc.edu
hofsteda at ucrwcu.rwc.uc.edu
Thu Jan 29 12:25:15 PST 2004
Quoting Michael M Slusarz <slusarz at bigworm.colorado.edu>:
> Quoting hofsteda at ucrwcu.rwc.uc.edu:
>
> > Is this expected behavior (since IE is messed up) or should I check my
> > horde/php/mime-magic configuration?
>
> You answered it yourself. If IE is misreporting it, there is nothing we can
> do
> about it since we honor what the browser tells us. So if it says it is an
> application/octet-stream, and MIME magic is enabled, we do a MIME magic scan.
> It seems reasonable that MIME magic might identify the file as text/plain, so
> there is technically nothing wrong.
>
> If you want to generate an improved MIME magic database system, that
> identifies
> the file correctly, that would be great. But (at least with our PHP coded
> version of MIME magic) there are 5 signtures for msword (it's actually MIME
> type text/vnd.ms-word) so if it is not recognzing it as a word file, it seems
> likely that it really doesn't _look_ like a word file at all so improved MIME
> magic detection is not going to help out any.
>
It appears office xp uses a common file format with a string of
\320\317\021\340\241\261 at the head of the file for all the apps. There are
strings defining the file as a word document but they are in the summary which
is tacked onto the end of the file. Kind of hard to define a offset for that.
You just have to luv msoft.
I tried setting the mime type on this string to application/octet-stream. This
caused the attachment to be listed twice. Once as an octet-stream and once as a
word document. Either link referrenced the same mime part and worked.
The real problem seems to be with mime_content_type on my system (php 4.3.4)
returning text/plain excessively (/bin/ping when I used a magic file without a
\177ELF setting.) Since it returns text/plain the extension check is never
executed. I'll look for a fix on php lists for this.
For now I just commented out the mime_content_type code in
MIME_Magic::analyzeFile to force the use of horde's mime_magic code. The check
now falls through to MIME_Magic::filenameToMIME and everything is good.
More information about the imp
mailing list