kamlesh-defsys/mime-types

A converter between mime types and file extensions.

Installs: 2

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 1

pkg:composer/kamlesh-defsys/mime-types

dev-main 2025-01-13 22:42 UTC

This package is not auto-updated.

Last update: 2025-12-31 01:29:57 UTC


README

Converts mime types to the proper file extensions and vice versa.

Installation

composer require kamlesh-defsys/mime-types

Usage

Create a new mime type converter instance:

use kamleshDefsys\MimeTypes\MimeTypeConverter;

$converter = new MimeTypeConverter;

Get the proper mime type for a file extension:

echo $converter->toMimeType('jpeg');

or find a file extension to the given mime type:

echo $converter->toExtension('image/jpeg');

Multiple extensions could belong to the same mime type so the code above will return with the first matching one.

Development

Create the Docker based development environment:

make dev

Check the coding style and run unit tests:

make test