Skip to content

totpero/MimeDb.Net

Repository files navigation

MimeDb.Net

NuGet

This is a port of the popular JavaScript mime-db library to C#

mime-db is a large database of mime types and information about them. It consists of a single, public JSON file and does not include any logic, allowing it to remain as un-opinionated as possible with an API. It aggregates data from the following sources:

Install the package:

dotnet add package MimeDb.Net

Usage

// grab data on .js files
var data = MimeDb.Items['application/javascript']

Data Structure

The JSON file is a map lookup for lowercased mime types. Each mime type has the following properties:

  • .source - where the mime type is defined. If not set, it's probably a custom media type.
  • .extensions[] - known extensions associated with this mime type.
  • .compressible - whether a file of this type can be gzipped.
  • .charset - the default charset associated with this type, if any.

Contributing

The primary way to contribute to this database is by creating pull request to the original repo mime-db. See the contribution rules.

About

Media Type Database in .NET

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages