Giter Site home page Giter Site logo

filetypedetective-trailmax's Introduction

This project is pretty much abandoned. But there is a fork on GitHub: https://github.com/Muraad/Mime-Detective These guys have a lot more types detectable, but no NuGet package yet -(

This repo has been migrated from https://filetypedetective.codeplex.com/

Description

Library to decide what type of file we are working with. Detects file types by header, not by file extension.

Every file has an extension and if it is a binary file, it has magic numbers in the header of the file that indicate what type of file it is. It is not always easy to work out programmatically what type of file it is, if there is no (or incorrect) extension. This library provides an easy way of identifying the file types.

At the moment library can detect files of types: Microsoft Word, Microsoft Excel, Microsoft PowerPoint, PDF, JPEG, ZIP, RAR, RTF, PNG, GIF

Great news. Nuget package is now available:

PM> Install-Package FileTypeDetective

Not many types are supported, I know! But it is easy to extend and add new types yourself. If you require new types, please let me know.

Downloadable zip includes source code, compiled DLL file and help file with API description (generated from XML comments). Or you can download the entire project from the source code and have a bash-on yourself. Source code also includes unit-tests.

The idea of the library is to be able to call isPdf(), isZip(), isDoc(), ect. on FileInfo objects:

FileInfo file = new FileInfo("C:\Hello.pdf");
if ( file.isPdf())
    Console.WriteLine("File is PDF");

There are some examples on Documentation page.

filetypedetective-trailmax's People

Contributors

trailmax avatar

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.