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
<PackageReference Include="MimeTypes" Version="2.5.2"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="MimeTypes" Version="2.5.2" />
<PackageReference Include="MimeTypes"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add MimeTypes --version 2.5.2
#r "nuget: MimeTypes, 2.5.2"
#addin nuget:?package=MimeTypes&version=2.5.2
#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 | Versions 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.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. |
This package has no dependencies.
NuGet packages (10)
Showing the top 5 NuGet packages that depend on MimeTypes:
Package | Downloads |
---|---|
Terradue.Stars
Stars is a set of services for working with Spatio Temporal Catalog such as STAC but not only |
|
Terradue.Data.Stars
Collection of data Plugins for Terradue.Stars |
|
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 |
|
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 (14)
Showing the top 14 popular GitHub repositories that depend on MimeTypes:
Repository | Stars |
---|---|
jellyfin/jellyfin
The Free Software Media System - Server Backend & API
|
|
alxnbl/onenote-md-exporter
ConsoleApp to export OneNote notebooks to Markdown formats
|
|
master131/iFakeLocation
Simulate locations on iOS devices on Windows, Mac and Ubuntu.
|
|
paillave/Etl.Net
Mass processing data with a complete ETL for .net developers
|
|
NetSparkleUpdater/NetSparkle
NetSparkle is a C#, cross-platform, highly-configurable software update framework with pre-built UI for .NET developers compatible with .NET 4.6.2/.NET 6+, WinForms, WPF, and Avalonia; uses Ed25519 signatures. View basic usage here in the README and try the samples for yourself.
|
|
trueai-org/midjourney-proxy
全球最大的 Midjourney 绘图 API,日绘图 100万+,总绘图 1 亿+
|
|
anobaka/Bakabase
A local media manager for all types of files. 二次元老司机专用的本地媒体文件管理器,支持管理和处理音视频、本子、图集、小说、哔哩哔哩视频、游戏甚至mod等各类资源
|
|
Daddoon/BlazorMobile
Create full C# driven hybrid-apps for iOS, Android, UWP & Desktop with Blazor!
|
|
bcssov/IronyModManager
Mod Manager for Paradox Games. Official Discord: https://discord.gg/t9JmY8KFrV
|
|
VirtoCommerce/vc-storefront
Virto Commerce Storefront - ASP.NET Core 8.0
|
|
stepanbenes/api-for-nopcommerce
API plugin for nopCommerce 4.50
|
|
vesoapp/veso
Open source media server.
|
|
BrycensRanch/SnapX
SnapX is a free, open-source, cross-platform tool that lets you capture or record any area of your screen and instantly share it with a single keypress. Upload images, videos, text, and more to multiple supported destinations—all with ease. ShareX fork
|
|
dukeofharen/httplaceholder
A very flexible cross platform HTTP stub application.
|
Version | Downloads | Last updated |
---|---|---|
2.5.2 | 1,133,745 | 3/27/2024 |
2.5.1 | 2,522 | 3/26/2024 |
2.5.0 | 504 | 3/26/2024 |
2.4.1 | 2,147,891 | 2/21/2023 |
2.4.0 | 1,605,494 | 3/29/2022 |
2.3.0 | 315,199 | 2/8/2022 |
2.2.1 | 509,157 | 8/24/2021 |
2.2.0 | 394,025 | 2/24/2021 |
2.1.4 | 527 | 8/23/2021 |
2.1.3 | 530 | 4/17/2021 |
2.1.2 | 478 | 4/12/2021 |
2.1.1 | 135,567 | 12/29/2020 |
2.1.0 | 1,277 | 12/29/2020 |
2.0.2 | 512,623 | 6/16/2020 |
2.0.1 | 51,004 | 5/28/2020 |
2.0.0 | 2,948 | 5/28/2020 |
1.1.0 | 1,492,113 | 9/19/2018 |
1.0.6 | 295,991 | 12/6/2016 |
1.0.5 | 5,194 | 7/13/2015 |
1.0.4 | 28,269 | 6/29/2015 |
1.0.3 | 1,260 | 6/29/2015 |
1.0.2 | 1,851 | 9/7/2014 |
1.0.1 | 1,312 | 9/7/2014 |
1.0.0 | 38,547 | 9/7/2014 |