Skip to content
This repository was archived by the owner on Sep 17, 2020. It is now read-only.

ancarda/file-detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ancarda/file-detector

MIME type detector for partial file streams of unlimited length

Latest Stable Version Total Downloads License Build Status Coverage Status

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.

The detector class can be used with any framework and has no dependencies. This library may be installed via composer with the following command:

composer require ancarda/file-detector

The detector can then be initalized and used, like so. For example:

<?php

$resource = fopen('example.jpg', 'r');
$detector = new \Ancarda\File\Detector;
$mimetype = $detector->determineMimeType($resource);

//$mimetype is now 'image/jpg'

About

MIME type detector for partial file streams of unlimited length

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages