To determine the mime type, sFire uses a list of file extensions. This can be handy if you want to determine the mime type of a file based on the file extension.
You can retrieve a mime type by calling the get method. This method accepts a string parameter as the extension of a file. It will return NULL if there is no result.
use sFire\System\Mime;
$mime = Mime :: get('txt');
echo $mime; //Outputs "text/plain"
Below is a list of extensions and their respective mime type.
| Extension | Mime type |
|---|---|
| 3dm | x-world/x-3dmf |
| 3dmf | x-world/x-3dmf |
| qd3 | x-world/x-3dmf |
| qd3d | x-world/x-3dmf |
| a | application/octet-stream |
| arc | application/octet-stream |
| arj | application/octet-stream |
| bin | application/octet-stream |
| com | application/octet-stream |
| dump | application/octet-stream |
| exe | application/octet-stream |
| lha | application/octet-stream |
| lhx | application/octet-stream |
| lzh | application/octet-stream |
| lzx | application/octet-stream |
| o | application/octet-stream |
| psd | application/octet-stream |
| saveme | application/octet-stream |
| uu | application/octet-stream |
| zoo | application/octet-stream |
| aab | application/x-authorware-bin |
| aam | application/x-authorware-map |
| aas | application/x-authorware-seg |
| abc | text/vnd.abc |
| acgi | text/html |
| htm | text/html |
| html | text/html |
| csv | text/csv |
| json | application/json |
| jsonp | application/javascript |
| htmls | text/html |
| htx | text/html |
| shtml | text/html |
| afl | video/animaflex |
| ai | application/postscript |
| eps | application/postscript |
| ps | application/postscript |
| aif | audio/aiff |
| aifc | audio/aiff |
| aiff | audio/aiff |
| aim | application/x-aim |
| aip | text/x-audiosoft-intra |
| ani | application/x-navi-animation |
| aos | application/x-nokia-9000-communicator-add-on-software |
| aps | application/mime |
| art | image/x-jg |
| asf | video/x-ms-asf |
| asx | video/x-ms-asf |
| asm | text/x-asm |
| s | text/x-asm |
| asp | text/asp |
| au | audio/basic |
| snd | audio/basic |
| avi | application/x-troff-msvideo |
| avs | video/avs-video |
| bcpio | application/x-bcpio |
| bm | image/bmp |
| bmp | image/bmp |
| boo | application/book |
| book | application/book |
| boz | application/x-bzip2 |
| bz2 | application/x-bzip2 |
| bsh | application/x-bsh |
| sh | application/x-bsh |
| shar | application/x-bsh |
| bz | application/x-bzip |
| c | text/plain |
| c++ | text/plain |
| cc | text/plain |
| conf | text/plain |
| cxx | text/plain |
| def | text/plain |
| f | text/plain |
| f90 | text/plain |
| for | text/plain |
| g | text/plain |
| h | text/plain |
| hh | text/plain |
| idc | text/plain |
| jav | text/plain |
| java | text/plain |
| list | text/plain |
| log | text/plain |
| lst | text/plain |
| m | text/plain |
| mar | text/plain |
| pl | text/plain |
| sdml | text/plain |
| text | text/plain |
| txt | text/plain |
| cpp | text/x-c |
| cat | application/vnd.ms-pki.seccat |
| ccad | application/clariscad |
| cco | application/x-cocoa |
| cdf | application/cdf |
| nc | application/x-netcdf |
| cer | application/pkix-cert |
| crt | application/pkix-cert |
| der | application/x-x509-ca-cert |
| cha | application/x-chat |
| chat | application/x-chat |
| class | application/java |
| cpio | application/x-cpio |
| cpt | application/mac-compactpro |
| crl | application/pkcs-crl |
| csh | application/x-csh |
| css | text/css |
| dcr | application/x-director |
| dir | application/x-director |
| dxr | application/x-director |
| deepv | application/x-deepv |
| dif | video/x-dv |
| dv | video/x-dv |
| dl | video/dl |
| doc | application/msword |
| dot | application/msword |
| w6w | application/msword |
| wiz | application/msword |
| word | application/msword |
| dp | application/commonground |
| drw | application/drafting |
| dvi | application/x-dvi |
| dwf | drawing/x-dwf (old) |
| dwg | application/acad |
| dxf | image/vnd.dwg |
| svf | image/vnd.dwg |
| el | text/x-script.elisp |
| elc | application/x-bytecode.elisp (compiled elisp) |
| env | application/x-envoy |
| evy | application/x-envoy |
| es | application/x-esrehber |
| etx | text/x-setext |
| f77 | text/x-fortran |
| fdf | application/vnd.fdf |
| fif | application/fractals |
| fli | video/fli |
| flo | image/florian |
| turbot | image/florian |
| flx | text/vnd.fmi.flexstor |
| fmf | video/x-atomic3d-feature |
| fpx | image/vnd.fpx |
| frl | application/freeloader |
| funk | audio/make |
| my | audio/make |
| pfunk | audio/make |
| g3 | image/g3fax |
| gif | image/gif |
| gl | video/gl |
| gsd | audio/x-gsm |
| gsm | audio/x-gsm |
| gsp | application/x-gsp |
| gss | application/x-gss |
| gtar | application/x-gtar |
| gz | application/x-compressed |
| tgz | application/x-compressed |
| z | application/x-compressed |
| zip | application/x-compressed |
| gzip | application/x-gzip |
| hdf | application/x-hdf |
| help | application/x-helpfile |
| hlp | application/x-helpfile |
| hgl | application/vnd.hp-hpgl |
| hpg | application/vnd.hp-hpgl |
| hpgl | application/vnd.hp-hpgl |
| hlb | text/x-script |
| hqx | application/binhex |
| hta | application/hta |
| htc | text/x-component |
| htt | text/webviewhtml |
| ice | x-conference/x-cooltalk |
| ico | image/x-icon |
| ief | image/ief |
| iefs | image/ief |
| iges | application/iges |
| igs | application/iges |
| ima | application/x-ima |
| imap | application/x-httpd-imap |
| inf | application/inf |
| ins | application/x-internett-signup |
| ip | application/x-ip2 |
| isu | video/x-isvideo |
| it | audio/it |
| iv | application/x-inventor |
| ivr | i-world/i-vrml |
| ivy | application/x-livescreen |
| jam | audio/x-jam |
| jcm | application/x-java-commerce |
| jfif | image/jpeg |
| jfif-tbnl | mage/jpeg |
| jpe | image/jpeg |
| jpeg | image/jpeg |
| jpg | image/jpeg |
| jps | image/x-jps |
| js | application/x-javascript |
| jut | image/jutvision |
| kar | audio/midi |
| mid | audio/midi |
| midi | audio/midi |
| ksh | application/x-ksh |
| la | audio/nspaudio |
| lma | audio/nspaudio |
| lam | audio/x-liveaudio |
| latex | application/x-latex |
| ltx | application/x-latex |
| lsp | application/x-lisp |
| lsx | text/x-la-asf |
| m1v | video/mpeg |
| m2v | video/mpeg |
| mp2 | video/mpeg |
| mp3 | video/mpeg |
| mpa | video/mpeg |
| mpe | video/mpeg |
| mpeg | video/mpeg |
| mpg | video/mpeg |
| m2a | audio/mpeg |
| mpga | audio/mpeg |
| m3u | audio/x-mpequrl |
| man | application/x-troff-man |
| map | application/x-navimap |
| mbd | application/mbedlet |
| mc$ | application/x-magic-cap-package-1.0 |
| mcd | application/mcad |
| mcf | image/vasa |
| mcp | application/netmc |
| me | application/x-troff-me |
| mht | message/rfc822 |
| mhtml | message/rfc822 |
| mime | message/rfc822 |
| mif | application/x-frame |
| mjf | audio/x-vnd.audioexplosion.mjuicemediafile |
| mjpg | video/x-motion-jpeg |
| mm | application/base64 |
| mme | application/base64 |
| mod | audio/mod |
| moov | video/quicktime |
| mov | video/quicktime |
| qt | video/quicktime |
| movie | video/x-sgi-movie |
| mv | video/x-sgi-movie |
| mpc | application/x-project |
| mpt | application/x-project |
| mpv | application/x-project |
| mpx | application/x-project |
| mpp | application/vnd.ms-project |
| mrc | application/marc |
| ms | application/x-troff-ms |
| mzz | application/x-vnd.audioexplosion.mzz |
| nap | image/naplps |
| naplps | image/naplps |
| ncm | application/vnd.nokia.configuration-message |
| nif | image/x-niff |
| niff | image/x-niff |
| nix | application/x-mix-transfer |
| nsc | application/x-conference |
| nvd | application/x-navidoc |
| oda | application/oda |
| omc | application/x-omc |
| omcd | application/x-omcdatamaker |
| omcr | application/x-omcregerator |
| p | text/x-pascal |
| p10 | application/pkcs10 |
| p12 | application/pkcs-12 |
| p7a | application/x-pkcs7-signature |
| p7c | application/pkcs7-mime |
| p7m | application/pkcs7-mime |
| p7r | application/x-pkcs7-certreqresp |
| p7s | application/pkcs7-signature |
| part | application/pro_eng |
| prt | application/pro_eng |
| pas | text/pascal |
| pbm | image/x-portable-bitmap |
| pcl | application/vnd.hp-pcl |
| pct | image/x-pict |
| pcx | image/x-pcx |
| pdb | chemical/x-pdb |
| xyz | chemical/x-pdb |
| application/pdf | |
| pgm | image/x-portable-graymap |
| pic | image/pict |
| pict | image/pict |
| pkg | application/x-newton-compatible-pkg |
| pko | application/vnd.ms-pki.pko |
| plx | application/x-pixclscript |
| pm | image/x-xpixmap |
| xpm | image/x-xpixmap |
| pm4 | application/x-pagemaker |
| pm5 | application/x-pagemaker |
| png | image/png |
| x-png | image/png |
| pnm | application/x-portable-anymap |
| pot | application/mspowerpoint |
| pps | application/mspowerpoint |
| ppt | application/mspowerpoint |
| ppz | application/mspowerpoint |
| ppa | application/vnd.ms-powerpoint |
| pwz | application/vnd.ms-powerpoint |
| pov | model/x-pov |
| ppm | image/x-portable-pixmap |
| pre | application/x-freelance |
| pvu | paleovu/x-pv |
| py | text/x-script.phyton |
| pyc | applicaiton/x-bytecode.python |
| qcp | audio/vnd.qcelp |
| qif | image/x-quicktime |
| qti | image/x-quicktime |
| qtif | image/x-quicktime |
| qtc | video/x-qtc |
| ra | audio/x-pn-realaudio |
| ram | audio/x-pn-realaudio |
| rm | audio/x-pn-realaudio |
| rmm | audio/x-pn-realaudio |
| rmp | audio/x-pn-realaudio |
| rpm | audio/x-pn-realaudio-plugin |
| ras | application/x-cmu-raster |
| rast | image/cmu-raster |
| rexx | text/x-script.rexx |
| rf | image/vnd.rn-realflash |
| rgb | image/x-rgb |
| rmi | audio/mid |
| rng | application/ringing-tones |
| rnx | application/vnd.rn-realplayer |
| roff | application/x-troff |
| t | application/x-troff |
| tr | application/x-troff |
| rp | image/vnd.rn-realpix |
| rt | text/richtext |
| rtf | text/richtext |
| rtx | text/richtext |
| rv | video/vnd.rn-realvideo |
| s3m | audio/s3m |
| sbk | application/x-tbook |
| tbk | application/x-tbook |
| scm | application/x-lotusscreencam |
| sdp | application/sdp |
| sdr | application/sounder |
| sea | application/sea |
| set | application/set |
| sgm | text/sgml |
| sgml | text/sgml |
| ssi | text/x-server-parsed-html |
| sid | audio/x-psid |
| sit | application/x-sit |
| skd | application/x-koan |
| skm | application/x-koan |
| skp | application/x-koan |
| skt | application/x-koan |
| sl | application/x-seelogo |
| smi | application/smil |
| smil | application/smil |
| sol | application/solids |
| spc | application/x-pkcs7-certificates |
| talk | text/x-speech |
| spl | application/futuresplash |
| spr | application/x-sprite |
| sprite | application/x-sprite |
| src | application/x-wais-source |
| wsrc | application/x-wais-source |
| ssm | application/streamingmedia |
| sst | application/vnd.ms-pki.certstore |
| step | application/step |
| stp | application/step |
| stl | application/sla |
| sv4cpio | application/x-sv4cpio |
| sv4crc | application/x-sv4crc |
| svr | application/x-world |
| wrl | application/x-world |
| swf | application/x-shockwave-flash |
| tar | application/x-tar |
| tcl | application/x-tcl |
| tcsh | text/x-script.tcsh |
| tex | application/x-tex |
| texi | application/x-texinfo |
| texinfo | application/x-texinfo |
| tif | image/tiff |
| tiff | image/tiff |
| tsi | audio/tsp-audio |
| tsp | application/dsptype |
| tsv | text/tab-separated-values |
| uil | text/x-uil |
| uni | text/uri-list |
| unis | text/uri-list |
| uri | text/uri-list |
| uris | text/uri-list |
| unv | application/i-deas |
| ustar | application/x-ustar |
| uue | text/x-uuencode |
| vcd | application/x-cdlink |
| vcs | text/x-vcalendar |
| vda | application/vda |
| vdo | video/vdo |
| vew | application/groupwise |
| viv | video/vivo |
| vivo | video/vivo |
| vmd | application/vocaltec-media-desc |
| vmf | application/vocaltec-media-file |
| voc | audio/voc |
| vos | video/vosaic |
| vox | audio/voxware |
| vqe | audio/x-twinvq-plugin |
| vql | audio/x-twinvq-plugin |
| vqf | audio/x-twinvq |
| vrml | application/x-vrml |
| wrz | model/vrml |
| vrt | x-world/x-vrt |
| vsd | application/x-visio |
| vst | application/x-visio |
| vsw | application/x-visio |
| w60 | application/wordperfect6.0 |
| wp5 | application/wordperfect6.0 |
| w61 | application/wordperfect6.1 |
| wav | audio/wav |
| wb1 | application/x-qpro |
| wbmp | image/vnd.wap.wbmp |
| web | application/vnd.xara |
| wk1 | application/x-123 |
| wmf | windows/metafile |
| wml | text/vnd.wap.wml |
| wmlc | application/vnd.wap.wmlc |
| wmls | text/vnd.wap.wmlscript |
| wmlsc | application/vnd.wap.wmlscriptc |
| wp | application/wordperfect |
| wp6 | application/wordperfect |
| wpd | application/wordperfect |
| wq1 | application/x-lotus |
| wri | application/mswrite |
| wsc | text/scriplet |
| wtk | application/x-wintalk |
| xbm | image/x-xbitmap |
| xdr | video/x-amt-demorun |
| xgz | xgl/drawing |
| xif | image/vnd.xiff |
| xl | application/excel |
| xla | application/excel |
| xlb | application/excel |
| xlc | application/excel |
| xld | application/excel |
| xlk | application/excel |
| xll | application/excel |
| xlm | application/excel |
| xls | application/excel |
| xlt | application/excel |
| xlv | application/excel |
| xlw | application/excel |
| xm | audio/xm |
| xml | application/xml |
| xmz | xgl/movie |
| xpix | application/x-vnd.ls-xpix |
| xsr | video/x-amt-showrun |
| xwd | image/x-xwd |
| zsh | text/x-script.zsh |