Skip to content

Instantly share code, notes, and snippets.

@fnagel
Created December 18, 2009 15:32
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fnagel/259567 to your computer and use it in GitHub Desktop.
Save fnagel/259567 to your computer and use it in GitHub Desktop.
MIME type array
<?php
// MIME types definition
$types = array (
'3dmf' => 'x-world/x-3dmf',
'3dm' => 'x-world/x-3dmf',
'avi' => 'video/x-msvideo',
'ai' => 'application/postscript',
'bin' => 'application/octet-stream',
'bin' => 'application/x-macbinary',
'bmp' => 'image/bmp',
'cab' => 'application/x-shockwave-flash',
'c' => 'text/plain',
'c++' => 'text/plain',
'class' => 'application/java',
'css' => 'text/css',
'csv' => 'text/comma-separated-values',
'cdr' => 'application/cdr',
'doc' => 'application/msword',
'dot' => 'application/msword',
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
'dwg' => 'application/acad',
'eps' => 'application/postscript',
'exe' => 'application/octet-stream',
'gif' => 'image/gif',
'gz' => 'application/gzip',
'gtar' => 'application/x-gtar',
'flv' => 'video/x-flv',
'fh4' => 'image/x-freehand',
'fh5' => 'image/x-freehand',
'fhc' => 'image/x-freehand',
'help' => 'application/x-helpfile',
'hlp' => 'application/x-helpfile',
'html' => 'text/html',
'htm' => 'text/html',
'ico' => 'image/x-icon',
'imap' => 'application/x-httpd-imap',
'inf' => 'application/inf',
'jpe' => 'image/jpeg',
'jpeg' => 'image/jpeg',
'jpg' => 'image/jpeg',
'js' => 'application/x-javascript',
'java' => 'text/x-java-source',
'latex' => 'application/x-latex',
'log' => 'text/plain',
'm3u' => 'audio/x-mpequrl',
'midi' => 'audio/midi',
'mid' => 'audio/midi',
'mov' => 'video/quicktime',
'mp3' => 'audio/mpeg',
'mpeg' => 'video/mpeg',
'mpg' => 'video/mpeg',
'mp2' => 'video/mpeg',
'ogg' => 'application/ogg',
'phtml' => 'application/x-httpd-php',
'php' => 'application/x-httpd-php',
'pdf' => 'application/pdf',
'pgp' => 'application/pgp',
'png' => 'image/png',
'pps' => 'application/mspowerpoint',
'pps' => 'application/vnd.ms-powerpoint',
'ppt' => 'application/mspowerpoint',
'ppt' => 'application/vnd.ms-powerpoint',
'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
'ppz' => 'application/mspowerpoint',
'pot' => 'application/mspowerpoint',
'ps' => 'application/postscript',
'qt' => 'video/quicktime',
'qd3d' => 'x-world/x-3dmf',
'qd3' => 'x-world/x-3dmf',
'qxd' => 'application/x-quark-express',
'rar' => 'application/x-rar-compressed',
'ra' => 'audio/x-realaudio',
'ram' => 'audio/x-pn-realaudio',
'rm' => 'audio/x-pn-realaudio',
'rtf' => 'text/rtf',
'spr' => 'application/x-sprite',
'sprite' => 'application/x-sprite',
'stream' => 'audio/x-qt-stream',
'swf' => 'application/x-shockwave-flash',
'svg' => 'text/xml-svg',
'sgml' => 'text/x-sgml',
'sgm' => 'text/x-sgml',
'tar' => 'application/x-tar',
'tiff' => 'image/tiff',
'tif' => 'image/tiff',
'tgz' => 'application/x-compressed',
'tex' => 'application/x-tex',
'txt' => 'text/plain',
'vob' => 'video/x-mpg',
'wav' => 'audio/x-wav',
'wrl' => 'model/vrml',
'wrl' => 'x-world/x-vrml',
'xla' => 'application/msexcel',
'xla' => 'application/vnd.ms-excel',
'xlt' => 'application/msexcel',
'xlt' => 'application/vnd.ms-excel',
'xls' => 'application/msexcel',
'xls' => 'application/vnd.ms-excel',
'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
'xlc' => 'application/vnd.ms-excel',
'xml' => 'text/xml',
'zip' => 'application/x-zip-compressed',
'zip' => 'application/zip',
);
?>
@TRFN
Copy link

TRFN commented Sep 6, 2020

Great Job!

@azapata-coco
Copy link

Thanks a lot!

@fnagel
Copy link
Author

fnagel commented Jun 20, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment