Skip to content
forked from hey-red/Mime

Simple MIME type guesser for .NET and .NET Core.

License

Notifications You must be signed in to change notification settings

JornEngelbart/Mime

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mime

Simple MIME type guesser for .NET and .NET Core.

Install

via NuGet:

PM> Install-Package Mime

Requirements

Supports x64 OS(Linux and Windows). With .NET Framework you need to set platform x64.

Usage

using HeyRed.Mime;

// (Optionally) You can set path to magic database file manually.
MimeGuesser.MagicFilePath = "/path/to/magic/file";

// Guess mime type of file(overloaded method takes byte array or stream as arg.)
MimeGuesser.GuessMimeType("path/to/file") //=> image/jpeg

// Get extension of file(overloaded method takes byte array or stream as arg.)
MimeGuesser.GuessExtension("path/to/file") //=> jpeg

// Get mime type and extension of file(overloaded method takes byte array or stream as arg.)
MimeGuesser.GuessFileType("path/to/file") //=> FileType

Also available extension methods for FileInfo.

License

MIT

About

Simple MIME type guesser for .NET and .NET Core.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%