Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/frankhaugen/frank.mimetypes

This is a generated library that has a huge amout of mime-types integrated
https://github.com/frankhaugen/frank.mimetypes

content-types dotnet dotnet-core library mime-types nuget-package

Last synced: 16 days ago
JSON representation

This is a generated library that has a huge amout of mime-types integrated

Awesome Lists containing this project

README

        

# MimeTypes

[![.NET CI/CD Workflow](https://github.com/frankhaugen/Frank.MimeTypes/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/frankhaugen/Frank.MimeTypes/actions/workflows/main.yml)

This library provides a simple way to get the mime type of a file extension or the file extension of a mime type.

## Installation

### .NET CLI

```bash
dotnet add package Frank.MimeTypes
```

### Package Manager

```bash
Install-Package Frank.MimeTypes
```

### Package Reference

```xml

```

## Usage

### Namespace

```csharp
using Frank.MimeTypes;
```

### Get mime type from file extension

```csharp
var mimeType = MimeTypes.GetMimeType("txt");
```

### Get file extension from mime type

```csharp
var fileExtension = MimeTypes.GetFileExtension("text/plain");
```

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details