Skip to content

Detect MIME type from files in dotnet. This repo will help keep alive this old library `Mime-Detective` with minimal support.

License

Notifications You must be signed in to change notification settings

sandrock/Mime-Detective

 
 

Repository files navigation

Mime-Detective

Info

Detect MIME type from files.

This repo will help keep alive this old library with minimal support.
You should consider using the new one: Mime-Detective.

Nuget: SrkMimeDetective

Usage

// Both ways are writing the data to a temp file
// to get a FileInfo. GetFileType are extension methods
byte[] fileData = ...;
FileType fileType = fileData.GetFileType();
   
// or 
Stream fileDataStream = ...;
FileType fileType = fileDataStream.GetFileType();

// If writing to a temp file is not practicable use it like this
byte[] fileData = ...;
FileType fileType = MimeTypes.GetFileType(() => fileData);
   

Fork history

  1. https://filetypedetective.codeplex.com/ by trailmax, nuget FileTypeDetective, MIT
  2. https://github.com/Muraad/Mime-Detective, as GPL, changed to MIT
  3. https://github.com/clarkis117/Mime-Detective.git, nuget MimeDetective
  4. https://github.com/sandrock/Mime-Detective, nuget SrkMimeDetective

About

Detect MIME type from files in dotnet. This repo will help keep alive this old library `Mime-Detective` with minimal support.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 63.7%
  • Rich Text Format 35.5%
  • Other 0.8%