Oihana PHP

FileMimeType uses AudioMimeTypeTrait, ImageMimeTypeTrait, VideoMimeTypeTrait, ConstantsTrait

FileExtension

Enumeration class that defines various file mime-types supported by the application.

Tags
author

Marc Alcaraz (ekameleon)

since
1.0.0

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

AI

public array<string|int, mixed> AI = ['application/postscript', 'application/illustrator']

CBOR_SEQ

public string CBOR_SEQ = 'application/cbor-seq'

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']

JS

public array<string|int, mixed> JS = ['application/javascript', 'text/javascript']

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'

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']

PPTX

public string PPTX = 'application/vnd.openxmlformats-officedocument.presentationml.presentation'

SEVEN_Z

public string SEVEN_Z = 'application/x-7z-compressed'

SQLITE

public string SQLITE = 'application/vnd.sqlite3'

TAR

public array<string|int, mixed> TAR = ['application/tar', 'application/x-tar']

TAR_GZ_ENCRYPTED

public string TAR_GZ_ENCRYPTED = 'application/octet-stream'

XLSX

public string XLSX = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'

YAML

public array<string|int, mixed> YAML = ['application/x-yaml', 'text/yaml']

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>|null

getFromExtension()

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|null

resetCaches()

Reset the internal cache of the static methods.

public static resetCaches() : void
On this page

Search results