Skip to content

Mime type detector for files, byte arrays, and streams, .NET Standard Fork

License

Notifications You must be signed in to change notification settings

RealtyShares/Mime-Detective

 
 

Repository files navigation

Mime-Detective Build status codecov NuGet

Mime type for files.

Based on https://filetypedetective.codeplex.com/

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);
   

About

Mime type detector for files, byte arrays, and streams, .NET Standard Fork

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 96.7%
  • PowerShell 2.6%
  • Shell 0.7%