MimeTypes 2.5.2

Requires NuGet 3.3 or higher.

dotnet add package MimeTypes --version 2.5.2
NuGet\Install-Package MimeTypes -Version 2.5.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MimeTypes" Version="2.5.2">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MimeTypes --version 2.5.2
#r "nuget: MimeTypes, 2.5.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install MimeTypes as a Cake Addin
#addin nuget:?package=MimeTypes&version=2.5.2

// Install MimeTypes as a Cake Tool
#tool nuget:?package=MimeTypes&version=2.5.2

MimeTypes

A simple lookup from file name/extension to MIME/media type and vice versa, generated from mime-db, which in turn is compiled from IANA, Apache and nginx's MIME types.
This is a source-only package, containing a single class, MimeTypes, which will be compiled into your library/application under the root namespace.

Installation

The easiest way to get it, is to install the source package from NuGet.org.

Otherwise you could just pull the source file from GitHub.

Usage

Lookup MIME/media type for a file name/extension

Get the MIME/media type for a file name/extension by using the MimeTypes.TryGetMimeType or MimeTypes.GetMimeType methods:

if (MimeTypes.TryGetMimeType("awesome-file.json", out var mimeType))
{
    // mimeType == "application/json"
}

MimeTypes.GetMimeType("awesome-file.json"); // "application/json"

When calling GetMimeType, if a mapping for the given file extension doesn't exist, it will fall back to MimeTypes.FallbackMimeType, which is set to application/octet-stream by default.

Lookup file extension by MIME/media type

To get all available file extensions for a MIME/media type, you can call MimeTypes.GetMimeTypeExtensions. This returns back an IEnumerable<string> of all the available files types for the specified MIME/media type.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 is compatible.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 is compatible.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages (10)

Showing the top 5 NuGet packages that depend on MimeTypes:

Package Downloads
Terradue.Stars The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Stars is a set of services for working with Spatio Temporal Catalog such as STAC but not only

magic.io.services

Service implementations for magic.io that allows you to upload and download files to your ASP.NET Core application. To use package go to https://polterguy.github.io

Terradue.Data.Stars

Collection of data Plugins for Terradue.Stars

UXAV.AVnet.Core

Package Description

BlazorMobile

BlazorMobile: Launch Blazor as a mobile application on iOS, Android & UWP, with native communication support. Support iOS 12+, Android 4.4 >= and UWP. Install this package on your shared Xamarin.Forms app project.

GitHub repositories (11)

Showing the top 5 popular GitHub repositories that depend on MimeTypes:

Repository Stars
jellyfin/jellyfin
The Free Software Media System
master131/iFakeLocation
Simulate locations on iOS devices on Windows, Mac and Ubuntu.
alxnbl/onenote-md-exporter
ConsoleApp to export OneNote notebooks to Markdown formats
paillave/Etl.Net
Mass processing data with a complete ETL for .net developers
NetSparkleUpdater/NetSparkle
NetSparkle is a C# cross-platform software update framework for .NET developers compatible with .NET 4.6.2/.NET 6+, WinForms, WPF, and Avalonia; uses Ed25519 or DSA signatures! View basic usage here in the README or visit our website for code docs.
Version Downloads Last updated
2.5.2 9,904 3/27/2024
2.5.1 676 3/26/2024
2.5.0 139 3/26/2024
2.4.1 955,258 2/21/2023
2.4.0 1,133,437 3/29/2022
2.3.0 243,955 2/8/2022
2.2.1 416,382 8/24/2021
2.2.0 341,148 2/24/2021
2.1.4 440 8/23/2021
2.1.3 449 4/17/2021
2.1.2 402 4/12/2021
2.1.1 124,735 12/29/2020
2.1.0 895 12/29/2020
2.0.2 481,498 6/16/2020
2.0.1 44,646 5/28/2020
2.0.0 1,591 5/28/2020
1.1.0 1,314,632 9/19/2018
1.0.6 260,031 12/6/2016
1.0.5 4,936 7/13/2015
1.0.4 22,333 6/29/2015
1.0.3 1,112 6/29/2015
1.0.2 1,691 9/7/2014
1.0.1 1,161 9/7/2014
1.0.0 5,928 9/7/2014