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 (.xls) files detected as application/x-msi #348

Closed
iffa opened this issue Apr 7, 2020 · 3 comments
Closed

Excel (.xls) files detected as application/x-msi #348

iffa opened this issue Apr 7, 2020 · 3 comments

Comments

@iffa
Copy link

iffa commented Apr 7, 2020

Related to #162, #225

.xls files seem to be detected as msi files, even after msi false-positive fixes. Confirmed on files from Office 2016+, Mac & Windows.

See files: https://drive.google.com/open?id=1OqynCO-kHMolp4QFkiS3dAiBfJ58DYXi

@sindresorhus
Copy link
Owner

From the readme:

The following file types will not be accepted:

  • .xls - Too old and difficult to parse.

@iffa
Copy link
Author

iffa commented Apr 7, 2020

Totally missed that note, my bad.

@iffa iffa closed this as completed Apr 7, 2020
@msageryd
Copy link

msageryd commented Apr 9, 2020

I'm migrating to this library from my old home cooked file checking lib. I had a check for old xls files. Was it flawed? Otherwise, please integrate this test into your lib.

//Old XLS files
function isExcel(buf) {
  if (!buf || buf.length < 520) {
    return false;
  }

  return (
    buf[512] === 0x09 &&
    buf[513] === 0x08 &&
    buf[514] === 0x10 &&
    buf[515] === 0x00 &&
    buf[516] === 0x00 &&
    buf[517] === 0x06 &&
    buf[518] === 0x05 &&
    buf[519] === 0x00
  );
}

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