PHPackages                             dfridrich/php-mime-type - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dfridrich/php-mime-type

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dfridrich/php-mime-type
=======================

Simple PHP class for guessing file mime type based on file extension with ability to use in Symfony project.

v3.0.1(2y ago)17274.8k↑44.1%73MITPHPPHP ^8.1

Since Sep 8Pushed 2y ago2 watchersCompare

[ Source](https://github.com/dfridrich/PhpMimeType)[ Packagist](https://packagist.org/packages/dfridrich/php-mime-type)[ Docs](https://github.com/dfridrich/PhpMimeType)[ RSS](/packages/dfridrich-php-mime-type/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (2)Versions (13)Used By (3)

PhpMimeType v3
==============

[](#phpmimetype-v3)

[![Join the chat at https://gitter.im/dfridrich/PhpMimeType](https://camo.githubusercontent.com/3ff237c6c31d4cfac84bb9ef8c3cb0e39982c79e02a5267e0360539a75e73681/68747470733a2f2f6261646765732e6769747465722e696d2f6466726964726963682f5068704d696d65547970652e737667)](https://gitter.im/dfridrich/PhpMimeType?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)[![Build Status](https://camo.githubusercontent.com/e282c558f8157cf6de8ef5d7c6d1cbdebd99b3f3e74fd9da71ff1ed7b45b5b25/68747470733a2f2f7472617669732d63692e6f72672f6466726964726963682f5068704d696d65547970652e737667)](https://travis-ci.org/dfridrich/PhpMimeType)[![Latest Stable Version](https://camo.githubusercontent.com/7bc694174afb1ae66261a336609af598e76fb98a42e2b60edb716b318d4f519d/68747470733a2f2f706f7365722e707567782e6f72672f6466726964726963682f7068702d6d696d652d747970652f762f737461626c65)](https://packagist.org/packages/dfridrich/php-mime-type)[![Total Downloads](https://camo.githubusercontent.com/393c7bea16e07793e0691e9f6429e57d513e1ed04db4d10ebafb51bb32c85fd0/68747470733a2f2f706f7365722e707567782e6f72672f6466726964726963682f7068702d6d696d652d747970652f646f776e6c6f616473)](https://packagist.org/packages/dfridrich/php-mime-type)[![Monthly Downloads](https://camo.githubusercontent.com/445fcab24f2c1899e10ec2914c7fe86756818c07b7a75d4cbe320b451eb6307f/68747470733a2f2f706f7365722e707567782e6f72672f6466726964726963682f7068702d6d696d652d747970652f642f6d6f6e74686c79)](https://packagist.org/packages/dfridrich/php-mime-type)[![License](https://camo.githubusercontent.com/ed0e8818032caaa2516be4aa60940e576655d74898ce7b7baa849e9a2bc492d3/68747470733a2f2f706f7365722e707567782e6f72672f6466726964726963682f7068702d6d696d652d747970652f6c6963656e7365)](https://packagist.org/packages/dfridrich/php-mime-type)

[!["Buy Me A Coffee"](https://camo.githubusercontent.com/9f44ce2dc3b3eecdd02598900866ffc518801df1932849703dae1e5ce5031070/68747470733a2f2f7777772e6275796d6561636f666665652e636f6d2f6173736574732f696d672f637573746f6d5f696d616765732f6f72616e67655f696d672e706e67)](https://www.buymeacoffee.com/dfridrich)

[![PhpMimeType](phpmimetype.png "PhpMimeType")](phpmimetype.png)

Simple PHP class for guessing file mime type based on file extension with ability to use in Symfony project.

Install
-------

[](#install)

```
composer require dfridrich/php-mime-type
```

Usage
-----

[](#usage)

### Basic usage

[](#basic-usage)

```
