PHP Classes

PHP Mime Type Class: Determine the MIME type of a file

Recommend this page to a friend!
  Info   Screenshots   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 42%Total: 1,145 All time: 3,299 This week: 488Up
Version Licenses PHP version Categories
phpmimetypeclass 1.0Free For Educatio...5.0PHP 5, Files and Folders
Description 

Author

This class can be used to determine the MIME type of a file.

If the finfo extension is available it uses it to determine the MIME type of a given file.

If the finfo extension is not available, the class extracts the file name extension and looks up in an array that associates file name extensions to MIME types.

Picture of Robert Widdick
Name: Robert Widdick <contact>
Classes: 3 packages by
Country: United States United States

Screenshots (1)  
  • ss.jpg
  Files folder image Files (5)  
File Role Description
Plain text file class.mime.php Class This is a PHP 5 class for attempting to detect the MIME type of a file. Uses FINFO (if available), a pre-defined MIME list, mime_content_type() or defaults to "application/octet-stream" for unknown types.
Plain text file class.types.php Conf. This includes the robust array of mime types
Plain text file example.php Example An example of how to list all files in a directory and display its name, size and MIME type
Plain text file LICENSE.txt Lic. The GNU GPL License

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:1,145
This week:0
All time:3,299
This week:488Up
User Ratings User Comments (1)
 All time
Utility:60%StarStarStarStar
Consistency:55%StarStarStar
Documentation:-
Examples:70%StarStarStarStar
Tests:-
Videos:-
Overall:42%StarStarStar
Rank:3650
 
RTFM about Arrays
16 years ago (Aleksey)
7%Star