Login   Register  
PHP Classes
elePHPant
Icontem

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

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   Screenshots Screenshots   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2010-10-19 (4 years ago) RSS 2.0 feedStarStarStar 44%Total: 1,103 This week: 1All time: 3,155 This week: 1,384Up
Version Licenses PHP version Categories  
phpmimetypeclass 1.0Free For Educational Use, F...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
Age: 27
All time rank: 877113 in United States United States
Week rank: 757 Up75 in United States United States Up

Screenshots  
  • ss.jpg
  Files folder image Files  
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

 Version Control Unique User Downloads Download Rankings  
 0%Total:1,103All time:3,155
 This week:1This week:1,384Up
User Ratings User Comments (1)  
 All time
Utility:62%StarStarStarStar
Consistency:56%StarStarStar
Documentation:-
Examples:75%StarStarStarStar
Tests:-
Videos:-
Overall:44%StarStarStar
Rank:1981
 
RTFM about Arrays
5 years ago (Aleksey)
7%Star