PHPackages                             jaimevalasek/jv-mime-types - 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. jaimevalasek/jv-mime-types

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

jaimevalasek/jv-mime-types
==========================

A generic module MimeTypes ZF2 mainly used by module JVUpload.

069PHP

Since Oct 1Pushed 12y ago1 watchersCompare

[ Source](https://github.com/jaimevalasek/JVMimeTypes)[ Packagist](https://packagist.org/packages/jaimevalasek/jv-mime-types)[ RSS](/packages/jaimevalasek-jv-mime-types/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

JVMimeTypes - JV Mime Types
===========================

[](#jvmimetypes---jv-mime-types)

Create By: Jaime Marcelo Valasek

Use this module to validate the file upload using mime-types or extensions.

Futures video lessons can be developed and published on the website or Youtube channel  -

Installation
------------

[](#installation)

Download this module into your vendor folder.

After done the above steps, open the file `config/application.config.php`. And add the module with the name `JVMimeTypes`.

Using the JVMimeTypes
---------------------

[](#using-the-jvmimetypes)

Instantiating the class module JVMimeTypes

```
use JVMimeTypes\Service\MimeTypes;

$serviceMimeTypes = new MimeTypes($this->getServiceLocator()->get('servicemanager'));
```

```
/*
 * Listing the mime types with extensions as an index - custom in `config/module.config.php`
 * Passing false as the second parameter returns the numerical indices
 */

// This code below examples are the profiles that are within the configuration file `config/module.config.php`
'mime_types_custom' => array(
    'ext-images-thumb' => array(
        'jpg', 'jpeg', 'png', 'gif'
    ),
    'ext-images-min' => array(
        'jpg', 'jpeg', 'png', 'gif', 'bmp', 'tif'
    ),
    'ext-audio-min' => array(
        'mp3', 'wma'
    ),
    'ext-video-min' => array(
        'mp4', 'flv', 'avi', 'wmv'
    ),
    'ext-application-min' => array(
        'exe'
    ),
    'ext-ms-oficce' => array(
        'xls', 'doc', 'ppt', 'docx', 'xlsx'
    ),
)

// Executing of the method
exit(print_r($serviceMimeTypes->getMimeTypeCustom(array('ext-audio-min'))));

// Result
Array
(
    [mp3] => video/x-mpeg
    [wma] => audio/x-ms-wma
)

/*
 * Listing extensions custom audio
 */
exit(print_r($serviceMimeTypes->getExtCustom(array('ext-audio-min'))));

// result
Array
(
    [0] => mp3
    [1] => wma
)
```

All methods available
---------------------

[](#all-methods-available)

- Methods to bring standard file extensions `getExtImage();``getExtAudio();``getExtVideo();``getExtApplication();``getExtText();``getExtFiles();`
- Methods patterns to bring the mime types of files `getMimeTypeImage()``getMimeTypeAudio()``getMimeTypeVideo()``getMimeTypeApplication()``getMimeTypeText()``getMimeTypeFiles()`
- Methods custom - create your own profiles mime types accessing the file `config/module.config.php` just follow the examples are there and call the custom method, for example: `getExtCustom(array('ext-audio-min'));``getMimeTypeCustom(array('ext-audio-min'));`

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/c9b089b4d5ecfd26e5e4ef9013233a15d7598296ca76da1c92848dd41bec9d87?d=identicon)[jaimevalasek](/maintainers/jaimevalasek)

---

Top Contributors

[![jaimevalasek](https://avatars.githubusercontent.com/u/4160763?v=4)](https://github.com/jaimevalasek "jaimevalasek (5 commits)")

### Embed Badge

![Health badge](/badges/jaimevalasek-jv-mime-types/health.svg)

```
[![Health](https://phpackages.com/badges/jaimevalasek-jv-mime-types/health.svg)](https://phpackages.com/packages/jaimevalasek-jv-mime-types)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
