Mime



( ZN >= 5.2.0 )

This library provides information about the types of files.

 

 

# Methods


Mixed __call ()
String type ( String $ file )

 

 

# __Call ( ZN >= 5.2.0 )


Returns the file's mime value according to the extension. The file type to be learned is used as the method name.

Parameters

void
return Mixed

uses

output( Mime::avi() );
0 => string "video / x-msvideo ' (length = 17 )
1 => string ' video / msvideo ' (length = 15 )
2 => string ' video / avi ' (length = 11 )
3 => string " application / x-troff-msvideo ' (length = 29 )
echo Mime::aac();
audio / x-acc

 

 

# Type ( ZN >= 5.4.1 )


The file gives the mime.

Parameters

String $ file File path.
return String

uses

echo Mime::type('images/example.png');
image / png

 

 

# Defined Type List


To expand the list, click the MimeTypes you can take advantage of it.

File: Settings / Expressions.php
String $ acc "Audio / x-acc '
String $ ac3 "Audio / ac3 '
Array $ Ai 'application / pdf'
'application / postscript'
String $ aifc "Audio / x-aiff '
Array $ AiF 'audio / x-aiff'
'audio / aiff'
Array $ aiff 'audio / x-aiff'
'audio / aiff'
String $ Ai "Audio / x-ai '
Array $ avi 'video / x-msvideo'
'video / msvideo'
'video / avi'
'application / x-troff-msvideo'
Array $ thousand 'application / MACBinary'
'application / MACBinary'
'application / octet-stream'
'application / x-binary'
'application / x-MACBinary'
Array $ bmp 'image / bmp'
'image / x-bmp'
'image / xbitmap'
'image / x-xbitmap'
'image / x-win-bitmap'
'image / x-windows-bmp'
'image / ms-bmp '
' image / x-ms-bmp '
' application / bmp '
' application / x-bmp '
' application / x-win-bitmap '
Array $ Cd 'application / cd'
'application / CorelDraw'
'application / x-cd'
'application / x-CorelDraw'
'image / cd'
'image / x-cd'
'zz-application / zz-winassoc-cd'
Array $ Cer 'application / pkix-cert'
'application / x-x509-ca-cert'
String $ class "Application / octet-stream '
String $ cpt 'Application / mac-CompactPro'
Array $ CRLs 'application / pkix-crl'
'application / pkcs-crl'
Array $ cRT 'application / x-x509-ca-cert'
'application / x-x509-user
-cert'
String $ Csr "Application / octet-stream '
Array $ css 'text / css'
'text / plain'
Array $ csv "text / x-comma-separated-values'
'text / comma-separated-values'
' application / octet-stream '
' application / vnd.ms-excel '
' application / x-csv '
' text / x-csv '
'text / csv'
'application / csv'
'application / excel'
'application / vnd.msexcel
'
String $ Dc "Application / x-director '
String $ der "Application / x-x509-ca-cert '
String $ D "Application / x-director '
String $ dll "Application / octet-stream '
String $ dMs "Application / octet-stream '
Array $ doc 'application / msword'
'application / vnd.ms-office'
Array $ docx 'application /
zip'
'application / msword'
'application / x-zip'
Array $ dot 'application / msword'
'application / vnd.ms-office'
Array $ dotx 'application / vnd.openxmlformats-officedocument.wordprocessingml.document'
'application / zip'
'application / msword'
String $ Dvi "Application / x-dvi '
String $ Dx is "Application / x-director '
String $ eML "Message / rfc822"
String $ eps 'Application / postscript'
Array $ Exe 'application / octet-stream'
'application / x-msdownload'
String $ flac "Audio / x-FLAC '
String $ f4v 'Video / mp4'
String $ gif 'Image / gif'
String $ gpg 'Application / gpg-keys'
String $ GTR "Application / x-GTR '
String $ gz "Application / x-gzip '
String $ gzip "Application / x-gzip '
Array $ hqx 'application / mac-binhex40'
'application / mac-binhex'
'application / x
-binhex40'
Array $ htm 'text / html'
'text / plain'
Array $ html 'text / html'
'text / plain'
String $ iCal 'Text / calendar'
String $ icon 'Image / x-icon'
String $ ics 'Text / calendar'
Array $ Jr 'application / java-archive'
'application / x-java-application'
'application / x-jar'
'application / x-compressed'
Array $ jpeg 'image / jpeg' 'image / pjpeg'
Array $ jpg 'image / jpeg' 'image / pjpeg'
Array $ js 'application / x-javascript'
'text / plain'
Array $ Json 'application / json'
'text / json'
String $ Lhe "Application / octet-stream '
Array $ log 'text / plain' 'text / x-log'
String $ lzh "Application / octet-stream '
String $ KDB "Application / octet-stream '
Array $ CML 'application / vnd.google-earth.kml + xml'
'application / xml'
'text / xml'
Array $ kMZ 'application / vnd.google-earth.kmz'
'application / zip'
'application / x-zip'
String $ mid "Audio / midi '
String $ midi "Audio / midi '
String $ MiFi 'Application / vnd.mif'
String $ mover 'Video / quicktime'
String $ Movie 'Video / x-sgi-movie'
String $ mpeg 'Video / mpeg'
String $ mpg 'Video / mpeg'
String $ Mpg on 'Video / mpeg'
String $ Mp2 'Video / mpeg'
Array $ mp3 'audio / mpeg'
'audio / mpg'
'audio / mpeg3'
'audio / mp3'
String $ mp4 'Video / mp4'
String $ M3 'Text / plain'
String $ M4a "Audio / x-m4a '
String $ M4 'Application / vnd.mpegurl'
String $ room 'Application / B'
String $ ogg "Audio / ogg '
Array $ pdf 'application / pdf'
'application / force-download'
'application / x-download'
'binary / octet-stream'
Array $ PEM 'application / x-p50-user-cert'
'application / x-pem-file
'
String $ pGP 'Application / pgp'
Array $ php 'application / x-httpd-php'
'application / php'
'application / x-php'
'text / php
' text / x-php '
' application / x-httpd-php-source '
String $ pHP5 'Application / x-httpd-php-source'
String $ phtml 'Application / x-httpd-php
Array $ png 'image / png'
'image / x-png'
Array $ ppt 'application / powerpoint'
'application / vnd.ms-powerpoint
' application / vnd.ms-office
'application / msword'
Array $ pPTX 'application / vnd.openxmlformats-officedocument.presentationml.presentation'
'application / x-zip'
'application / zip'
String $ ps 'Application / postscript'
Array $ psd 'application / x-photoshop'
'image / vnd.adobe.photoshop'
Array $ p10 'application / x-pkcs10'
'application / pkcs10'
String $ p12 "Application / x-pkcs12 '
String $ P7 to "Application / x-pkcs7-signature '
Array $ p7c 'application / pkcs7-mime'
'application / x-pkcs7-mime'
Array $ P7M 'application / pkcs7-mime'
'application / x-pkcs7-mime'
String $ P7 is "Application / x-pkcs7-certreqresp '
String $ p7s 'Application / PKCS7-signature'
String $ qt 'Video / quicktime'
String $ Ra "Audio / x-RealAudio '
String $ Ram "Audio / x-pn-RealAudio '
Array $ Rar 'application / x-rar'
'application / rar'
'application / x-rar-compressed'
String $ rm "Audio / x-pn-RealAudio '
String $ rpm "Audio / x-pn-RealAudio-plugin '
String $ RSA "Application / x-pkcs7 '
String $ rtf 'Text / rtf'
String $ rtx 'Text / richtext'
String $ rv 'Video / vnd.rn-RealVideo'
String $ Sea "Application / octet-stream '
Array $ shtml 'text / html'
'text / plain'
String $ situ "Application / x-StuffiT '
String $ Partial 'Application / smile'
String $ smile 'Application / smile'
String $ sou "Application / octet-stream '
Array $ sRT 'text / srt'
'text / plain'
String $ sst "Application / octet-stream '
Array $ svg 'image / svg + xml'
'application / xml'
'text / xml'
String $ SWFs 'Application / x-shockwave-flash'
String $ T "Application / x-tar
String $ text 'Text / plain'
Array $ tgz 'application / x-tar'
'application / x-gzip-compressed'
String $ tif 'Image / tiff'
String $ tiff 'Image / tiff'
String $ txt 'Text / plain'
String $ vcf "Text / x-vcard"
String $ vLC 'Application / VideoLan'
Array $ vTT 'text / vtt'
'text / plain'
Array $ wav 'audio / x-wav'
'audio / wave'
'audio / wav'
String $ WBXML 'Application / WBXML'
String $ WebM 'Videos / WebM'
Array $ Wma 'audio / x-ms-wma'
'video / x-ms-asf'
String $ wmlc 'Application / wmlc'
Array $ wmv 'video / x-ms-wmv'
'video / x-ms-asf'
Array $ word 'application / msword'
'application / octet-stream'
String $ XHT 'Application / xhtml + xml'
String $ xhtml 'Application / xhtml + xml'
String $ xl 'Application / excel'
Array $ xls 'application / vnd.ms-excel'
'application / msexcel'
'application / x-msexcel'
'application / x-msexcel'
'application / x-excel'
'application / x-dos_ms_excel'
'application / xls'
' application / x-xls'
'application / excel'
'application / download'
'application / vnd.ms-office
'
Array $ .XLSX 'application / x-
zip'
'application / vnd.openxmlformats-officedocument.spreadsheetml.sheet
'
'application / zip'
Array $ xml 'application / xml'
'text / xml'
'text / plain'
Array $ xsl 'application / xml'
'text / xsl'
'text / xml'
String $ xspf 'Application / xml + XSPF'
String $ z 'Application / x-compress'
Array $ zip "application / x-zip '
' application / zip '
' application / x-zip-compressed '
' application / s-compressed '
' multipart / x-zip '
String $ zsh "Text / x-scriptzsh '
Array $ 3gp 'video / 3gp'
'video / 3gpp'
String $ 3g2 'Videos / 3GPP2'
Array $ 7zip 'application / x-compressed'
'application / x-zip-compressed'
'application /
zip'