dev-master
9999999-devMIME type detector for partial file streams of unlimited length
MIT
The Requires
- php >=7.0
The Development Requires
by Mark Dain
Wallogit.com
2017 © Pedro Peláez
MIME type detector for partial file streams of unlimited length
MIME type detector for partial file streams of unlimited length, (*1)
file-detector is a library for PHP 7.0+ that accepts a file stream of any length, even if it's a partial file type, and provides a MIME detector for it., (*3)
The detector class can be used with any framework and has no dependencies. This library may be installed via composer with the following command:, (*4)
composer require ancarda/file-detector
The detector can then be initalized and used, like so. For example:, (*5)
<?php
$resource = fopen('example.jpg', 'r');
$detector = new \Ancarda\File\Detector;
$mimetype = $detector->determineMimeType($resource);
//$mimetype is now 'image/jpg'
MIME type detector for partial file streams of unlimited length
MIT