FileMimeType uses AudioMimeTypeTrait, ImageMimeTypeTrait, VideoMimeTypeTrait, ConstantsTrait
FileExtension
Enumeration class that defines various file mime-types supported by the application.
Tags
Table of Contents
Constants
- AAC : string = 'audio/aac'
- ACCDB : string = 'application/msaccess'
- AI : array<string|int, mixed> = ['application/postscript', 'application/illustr...
- APP : string = 'application/octet-stream'
- AVI : string = 'video/x-msvideo'
- AVIF : string = 'image/avif'
- BAT : string = 'application/x-bat'
- BMP : string = 'image/bmp'
- CBOR : string = 'application/cbor'
- CBOR_SEQ : string = 'application/cbor-seq'
- COM : string = 'application/x-msdownload'
- COSE : string = 'application/cose'
- CSS : string = 'text/css'
- CSV : string = 'text/csv'
- CUR : string = 'image/x-icon'
- DB : string = 'application/octet-stream'
- DLL : string = 'application/x-msdownload'
- DMG : string = 'application/x-apple-diskimage'
- DOC : string = 'application/msword'
- DOCX : string = 'application/vnd.openxmlformats-officedocument....
- ENCRYPTED : string = 'application/octet-stream'
- EXE : array<string|int, mixed> = ['application/x-msdownload', 'application/vnd.m...
- FLAC : string = 'audio/flac'
- FLV : string = 'video/x-flv'
- GIF : string = 'image/gif'
- GZ : string = 'application/gzip'
- HEIC : string = 'image/heic'
- HEIF : string = 'image/heif'
- HTM : string = 'text/html'
- HTML : string = 'text/html'
- ICO : string = 'image/vnd.microsoft.icon'
- JAR : string = 'application/java-archive'
- JPEG : string = 'image/jpeg'
- JPG : string = 'image/jpeg'
- JS : array<string|int, mixed> = ['application/javascript', 'text/javascript']
- JSON : string = 'application/json'
- M4A : array<string|int, mixed> = ['audio/mp4', 'audio/x-m4a']
- M4V : array<string|int, mixed> = ['video/x-m4', 'video/mp4v']
- MD : string = 'text/markdown'
- MDB : string = 'application/x-msaccess'
- MKV : string = 'video/x-matroska'
- MOV : string = 'video/quicktime'
- MP3 : string = 'audio/mpeg'
- MP4 : string = 'video/mp4'
- MPEG : string = 'video/mpeg'
- MPG : string = 'video/mpeg'
- ODP : string = 'application/vnd.oasis.opendocument.presentation'
- ODS : string = 'application/vnd.oasis.opendocument.spreadsheet'
- ODT : string = 'application/vnd.oasis.opendocument.text'
- OGG : string = 'audio/ogg'
- OTF : string = 'font/otf'
- PDF : string = 'application/pdf'
- PHP : array<string|int, mixed> = ['application/x-php', 'application/x-httpd-php'...
- PNG : string = 'image/png'
- PPT : string = 'application/vnd.ms-powerpoint'
- PPTX : string = 'application/vnd.openxmlformats-officedocument....
- PSD : string = 'image/vnd.adobe.photoshop'
- RAR : string = 'application/vnd.rar'
- RTF : string = 'application/rtf'
- SEVEN_Z : string = 'application/x-7z-compressed'
- SH : string = 'application/x-sh'
- SQL : string = 'application/sql'
- SQLITE : string = 'application/vnd.sqlite3'
- SVG : string = 'image/svg+xml'
- TAR : array<string|int, mixed> = ['application/tar', 'application/x-tar']
- TAR_BZ2 : string = 'application/x-bzip2'
- TAR_GZ : string = 'application/gzip'
- TAR_GZ_ENCRYPTED : string = 'application/octet-stream'
- TGZ : string = 'application/gzip'
- TIF : string = 'image/tiff'
- TIFF : string = 'image/tiff'
- TOML : string = 'application/toml'
- TTF : string = 'font/ttf'
- TXT : string = 'text/plain'
- WAV : string = 'audio/wav'
- WEBM : string = 'video/webm'
- WEBP : string = 'image/webp'
- WMA : string = 'audio/x-ms-wma'
- WMV : string = 'video/x-ms-wmv'
- WOFF : string = 'font/woff'
- WOFF2 : string = 'font/woff2'
- XLS : string = 'application/vnd.ms-excel'
- XLSX : string = 'application/vnd.openxmlformats-officedocument....
- XML : string = 'application/xml'
- YAML : array<string|int, mixed> = ['application/x-yaml', 'text/yaml']
- YML : string = 'application/x-yaml'
- ZIP : string = 'application/zip'
Properties
- $EXTENSIONS : array<string|int, mixed>|null
Methods
- getExtension() : string|array<string|int, mixed>|null
- Returns the mimetype(s) for a given code.
- getFromExtension() : array<string|int, mixed>|string|null
- Returns the extension(s) of the specific mime-type value.
- resetCaches() : void
- Reset the internal cache of the static methods.
Constants
AAC
public
string
AAC
= 'audio/aac'
ACCDB
public
string
ACCDB
= 'application/msaccess'
AI
public
array<string|int, mixed>
AI
= ['application/postscript', 'application/illustrator']
APP
public
string
APP
= 'application/octet-stream'
AVI
public
string
AVI
= 'video/x-msvideo'
AVIF
public
string
AVIF
= 'image/avif'
BAT
public
string
BAT
= 'application/x-bat'
BMP
public
string
BMP
= 'image/bmp'
CBOR
public
string
CBOR
= 'application/cbor'
CBOR_SEQ
public
string
CBOR_SEQ
= 'application/cbor-seq'
COM
public
string
COM
= 'application/x-msdownload'
COSE
public
string
COSE
= 'application/cose'
CSS
public
string
CSS
= 'text/css'
CSV
public
string
CSV
= 'text/csv'
CUR
public
string
CUR
= 'image/x-icon'
DB
public
string
DB
= 'application/octet-stream'
DLL
public
string
DLL
= 'application/x-msdownload'
DMG
public
string
DMG
= 'application/x-apple-diskimage'
DOC
public
string
DOC
= 'application/msword'
DOCX
public
string
DOCX
= 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
ENCRYPTED
public
string
ENCRYPTED
= 'application/octet-stream'
EXE
public
array<string|int, mixed>
EXE
= ['application/x-msdownload', 'application/vnd.microsoft.portable-executable']
FLAC
public
string
FLAC
= 'audio/flac'
FLV
public
string
FLV
= 'video/x-flv'
GIF
public
string
GIF
= 'image/gif'
GZ
public
string
GZ
= 'application/gzip'
HEIC
public
string
HEIC
= 'image/heic'
HEIF
public
string
HEIF
= 'image/heif'
HTM
public
string
HTM
= 'text/html'
HTML
public
string
HTML
= 'text/html'
ICO
public
string
ICO
= 'image/vnd.microsoft.icon'
JAR
public
string
JAR
= 'application/java-archive'
JPEG
public
string
JPEG
= 'image/jpeg'
JPG
public
string
JPG
= 'image/jpeg'
JS
public
array<string|int, mixed>
JS
= ['application/javascript', 'text/javascript']
JSON
public
string
JSON
= 'application/json'
M4A
public
array<string|int, mixed>
M4A
= ['audio/mp4', 'audio/x-m4a']
M4V
public
array<string|int, mixed>
M4V
= ['video/x-m4', 'video/mp4v']
MD
public
string
MD
= 'text/markdown'
MDB
public
string
MDB
= 'application/x-msaccess'
MKV
public
string
MKV
= 'video/x-matroska'
MOV
public
string
MOV
= 'video/quicktime'
MP3
public
string
MP3
= 'audio/mpeg'
MP4
public
string
MP4
= 'video/mp4'
MPEG
public
string
MPEG
= 'video/mpeg'
MPG
public
string
MPG
= 'video/mpeg'
ODP
public
string
ODP
= 'application/vnd.oasis.opendocument.presentation'
ODS
public
string
ODS
= 'application/vnd.oasis.opendocument.spreadsheet'
ODT
public
string
ODT
= 'application/vnd.oasis.opendocument.text'
OGG
public
string
OGG
= 'audio/ogg'
OTF
public
string
OTF
= 'font/otf'
public
string
PDF
= 'application/pdf'
PHP
public
array<string|int, mixed>
PHP
= ['application/x-php', 'application/x-httpd-php', 'application/x-httpd-php-source', 'text/php', 'text/x-php', 'application/php']
PNG
public
string
PNG
= 'image/png'
PPT
public
string
PPT
= 'application/vnd.ms-powerpoint'
PPTX
public
string
PPTX
= 'application/vnd.openxmlformats-officedocument.presentationml.presentation'
PSD
public
string
PSD
= 'image/vnd.adobe.photoshop'
RAR
public
string
RAR
= 'application/vnd.rar'
RTF
public
string
RTF
= 'application/rtf'
SEVEN_Z
public
string
SEVEN_Z
= 'application/x-7z-compressed'
SH
public
string
SH
= 'application/x-sh'
SQL
public
string
SQL
= 'application/sql'
SQLITE
public
string
SQLITE
= 'application/vnd.sqlite3'
SVG
public
string
SVG
= 'image/svg+xml'
TAR
public
array<string|int, mixed>
TAR
= ['application/tar', 'application/x-tar']
TAR_BZ2
public
string
TAR_BZ2
= 'application/x-bzip2'
TAR_GZ
public
string
TAR_GZ
= 'application/gzip'
TAR_GZ_ENCRYPTED
public
string
TAR_GZ_ENCRYPTED
= 'application/octet-stream'
TGZ
public
string
TGZ
= 'application/gzip'
TIF
public
string
TIF
= 'image/tiff'
TIFF
public
string
TIFF
= 'image/tiff'
TOML
public
string
TOML
= 'application/toml'
TTF
public
string
TTF
= 'font/ttf'
TXT
public
string
TXT
= 'text/plain'
WAV
public
string
WAV
= 'audio/wav'
WEBM
public
string
WEBM
= 'video/webm'
WEBP
public
string
WEBP
= 'image/webp'
WMA
public
string
WMA
= 'audio/x-ms-wma'
WMV
public
string
WMV
= 'video/x-ms-wmv'
WOFF
public
string
WOFF
= 'font/woff'
WOFF2
public
string
WOFF2
= 'font/woff2'
XLS
public
string
XLS
= 'application/vnd.ms-excel'
XLSX
public
string
XLSX
= 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
XML
public
string
XML
= 'application/xml'
YAML
public
array<string|int, mixed>
YAML
= ['application/x-yaml', 'text/yaml']
YML
public
string
YML
= 'application/x-yaml'
ZIP
public
string
ZIP
= 'application/zip'
Properties
$EXTENSIONS
private
static array<string|int, mixed>|null
$EXTENSIONS
= null
Methods
getExtension()
Returns the mimetype(s) for a given code.
public
static getExtension(string $mimeType) : string|array<string|int, mixed>|null
Parameters
- $mimeType : string
-
The mime type to evaluates.
Return values
string|array<string|int, mixed>|nullgetFromExtension()
Returns the extension(s) of the specific mime-type value.
public
static getFromExtension(string $extension) : array<string|int, mixed>|string|null
Parameters
- $extension : string
-
The extension to evaluates.
Return values
array<string|int, mixed>|string|nullresetCaches()
Reset the internal cache of the static methods.
public
static resetCaches() : void