Giter VIP home page Giter VIP logo

Comments (3)

flowchartsman avatar flowchartsman commented on May 13, 2024 1

I do not know about the older types, but you cannot do xlsx, docx and the like without breaking your 261 byte guarantee. These are zip files, and accurately distinguishing them from one another will require you to dive much further into the file:

https://fossies.org/linux/misc/file-5.35.tar.gz:t/file-5.35/magic/Magdir/msooxml

To do this, you could enable a "deep scanning" mode that will make guarantees only that it does not need to scan past some value X, where X is the deepest possible match of all possible patterns. Otherwise, you're probably stuck with identifying these as .zip.

EDIT 2-3-19: update link

from filetype.

h2non avatar h2non commented on May 13, 2024

If we have the file signature schemas, we can support them easily. If you share someinfo about them or send a PR, I would not mind supporting them.

from filetype.

igungor avatar igungor commented on May 13, 2024

agree with @flowchartsman. file command correctly detects the filetype for a Microsoft Word 2007+ file, which is a ZIP file if you don't dive deep enough.

https://github.com/file/file/blob/master/magic/Magdir/msooxml#L30

from filetype.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.