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

Can i be able to differentiate between .xlsm and .xlsx files using mmmagic ? #176

Open
sunder-asuri opened this issue Oct 22, 2024 · 1 comment
Labels

Comments

@sunder-asuri
Copy link

i am trying to upload files and as the magic numbers of both .xlsm and .xlsx is same when i try to use this code

  let magic = new Magic(MAGIC_MIME_TYPE);
 magic.detectFile(fileLocation, (err, mimeType) => {
 if (err) throw err;
 console.log(mimeType);

 })
 

here if i upload a .xlsm file i get mime type as application/vnd.openxmlformats-officedocument.spreadsheetml.sheet which is same as for .xlsx file-type where as it should be application/vnd.ms-excel.sheet.macroEnabled.12.
same is the case with .ppsm (getting mime type of .ppsx) and .docm (getting mime type of .docx)

is there a way to identify macro enabled files using this package in any way ?

@mscdex
Copy link
Owner

mscdex commented Oct 22, 2024

That's entirely dependent upon whatever magic database you're using.

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

No branches or pull requests

2 participants