Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Excel and Powerpoint 97-2003 files return null mime type #4

Open
zAlbee opened this issue Jan 16, 2014 · 3 comments
Open

Excel and Powerpoint 97-2003 files return null mime type #4

zAlbee opened this issue Jan 16, 2014 · 3 comments

Comments

@zAlbee
Copy link

zAlbee commented Jan 16, 2014

I searched my magic file and found a few suspect entries for Excel, but found nothing for Powerpoint. Then I grep'd the source code of file-5.16 and found this in readcdf.c:

} app2mime[] =  {
    { "Word",           "msword",       },
    { "Excel",          "vnd.ms-excel",     },
    { "Powerpoint",         "vnd.ms-powerpoint",    },
    { "Crystal Reports",        "x-rpt",        },
    { "Advanced Installer",     "vnd.ms-msi",       },
    { "InstallShield",      "vnd.ms-msi",       },
    { "Microsoft Patch Compiler",   "vnd.ms-msi",       },
    { "NAnt",           "vnd.ms-msi",       },
    { "Windows Installer",      "vnd.ms-msi",       },
    { NULL,             NULL,           },
},

Looks like in version 5.x of file, they use CDF to parse MS Office documents instead of magic numbers.

The major changes for 5.x are CDF file parsing, indirect magic, and
overhaul in mime and ascii encoding handling.

src/cdf.c - parser for Microsoft Compound Document Files
src/readcdf.c - CDF wrapper.

@j256
Copy link
Owner

j256 commented Jan 16, 2014

Thanks for this. I'm not sure I'm interested in writing a CDF specific wrapper unfortunately. I wonder if there are pieces of it that I can extract and turn into magic patterns.

@joistick11
Copy link

Is this still not fixed? Cannot determine the mime type of xls and ppt

@j256
Copy link
Owner

j256 commented Aug 8, 2018

Feel free to donate the code @joistick11 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants