ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
MimeType.php
Go to the documentation of this file.
1<?php
2
19namespace ILIAS\FileUpload;
20
30{
31 public const APPLICATION__ACAD = 'application/acad';
32 public const APPLICATION__ARJ = 'application/arj';
33 public const APPLICATION__ASTOUND = 'application/astound';
34 public const APPLICATION__BASE64 = 'application/base64';
35 public const APPLICATION__BINHEX = 'application/binhex';
36 public const APPLICATION__BINHEX4 = 'application/binhex4';
37 public const APPLICATION__BOOK = 'application/book';
38 public const APPLICATION__CDF = 'application/cdf';
39 public const APPLICATION__CLARISCAD = 'application/clariscad';
40 public const APPLICATION__COMMONGROUND = 'application/commonground';
41 public const APPLICATION__DRAFTING = 'application/drafting';
42 public const APPLICATION__DSPTYPE = 'application/dsptype';
43 public const APPLICATION__DXF = 'application/dxf';
44 public const APPLICATION__ECMASCRIPT = 'application/ecmascript';
45 public const APPLICATION__ENVOY = 'application/envoy';
46 public const APPLICATION__EPUB = 'application/epub+zip';
47 public const APPLICATION__EXCEL = 'application/excel';
48 public const APPLICATION__FONT_WOFF = 'application/font-woff';
49 public const APPLICATION__FRACTALS = 'application/fractals';
50 public const APPLICATION__FREELOADER = 'application/freeloader';
51 public const APPLICATION__FUTURESPLASH = 'application/futuresplash';
52 public const APPLICATION__GNUTAR = 'application/gnutar';
53 public const APPLICATION__GROUPWISE = 'application/groupwise';
54 public const APPLICATION__HLP = 'application/hlp';
55 public const APPLICATION__HTA = 'application/hta';
56 public const APPLICATION__IGES = 'application/iges';
57 public const APPLICATION__INF = 'application/inf';
58 public const APPLICATION__I_DEAS = 'application/i-deas';
59 public const APPLICATION__JAVA = 'application/java';
60 public const APPLICATION__JAVASCRIPT = 'application/javascript';
61 public const APPLICATION__JAVA_BYTE_CODE = 'application/java-byte-code';
62 public const APPLICATION__JSON = 'application/json';
63 public const APPLICATION__LHA = 'application/lha';
64 public const APPLICATION__LZX = 'application/lzx';
65 public const APPLICATION__MACBINARY = 'application/macbinary';
66 public const APPLICATION__MAC_BINARY = 'application/mac-binary';
67 public const APPLICATION__MAC_BINHEX = 'application/mac-binhex';
68 public const APPLICATION__MAC_BINHEX40 = 'application/mac-binhex40';
69 public const APPLICATION__MAC_COMPACTPRO = 'application/mac-compactpro';
70 public const APPLICATION__MARC = 'application/marc';
71 public const APPLICATION__MBEDLET = 'application/mbedlet';
72 public const APPLICATION__MCAD = 'application/mcad';
73 public const APPLICATION__MIME = 'application/mime';
74 public const APPLICATION__MSPOWERPOINT = 'application/mspowerpoint';
75 public const APPLICATION__MSWORD = 'application/msword';
76 public const APPLICATION__MSWRITE = 'application/mswrite';
77 public const APPLICATION__NETMC = 'application/netmc';
78 public const APPLICATION__OCTET_STREAM = 'application/octet-stream';
79 public const APPLICATION__ODA = 'application/oda';
80 public const APPLICATION__OGG = 'application/ogg';
81 public const APPLICATION__PDF = 'application/pdf';
82 public const APPLICATION__PKCS10 = 'application/pkcs10';
83 public const APPLICATION__PKCS7_MIME = 'application/pkcs7-mime';
84 public const APPLICATION__PKCS7_SIGNATURE = 'application/pkcs7-signature';
85 public const APPLICATION__PKCS_12 = 'application/pkcs-12';
86 public const APPLICATION__PKCS_CRL = 'application/pkcs-crl';
87 public const APPLICATION__PKIX_CERT = 'application/pkix-cert';
88 public const APPLICATION__PKIX_CRL = 'application/pkix-crl';
89 public const APPLICATION__PLAIN = 'application/plain';
90 public const APPLICATION__POSTSCRIPT = 'application/postscript';
91 public const APPLICATION__POWERPOINT = 'application/powerpoint';
92 public const APPLICATION__PRO_ENG = 'application/pro_eng';
93 public const APPLICATION__RINGING_TONES = 'application/ringing-tones';
94 public const APPLICATION__RTF = 'application/rtf';
95 public const APPLICATION__SDP = 'application/sdp';
96 public const APPLICATION__SEA = 'application/sea';
97 public const APPLICATION__SEB = 'application/seb';
98 public const APPLICATION__SET = 'application/set';
99 public const APPLICATION__SLA = 'application/sla';
100 public const APPLICATION__SMIL = 'application/smil';
101 public const APPLICATION__SOLIDS = 'application/solids';
102 public const APPLICATION__SOUNDER = 'application/sounder';
103 public const APPLICATION__STEP = 'application/step';
104 public const APPLICATION__STREAMINGMEDIA = 'application/streamingmedia';
105 public const APPLICATION__TOOLBOOK = 'application/toolbook';
106 public const APPLICATION__VDA = 'application/vda';
107 public const APPLICATION__VND_FDF = 'application/vnd.fdf';
108 public const APPLICATION__VND_HP_HPGL = 'application/vnd.hp-hpgl';
109 public const APPLICATION__VND_HP_PCL = 'application/vnd.hp-pcl';
110 public const APPLICATION__VND_MS_EXCEL = 'application/vnd.ms-excel';
111 public const APPLICATION__VND_MS_EXCEL_ADDIN_MACRO_ENABLED_12 = 'application/vnd.ms-excel.addin.macroEnabled.12';
112 public const APPLICATION__VND_MS_EXCEL_SHEET_BINARY_MACRO_ENABLED_12 = 'application/vnd.ms-excel.sheet.binary.macroEnabled.12';
113 public const APPLICATION__VND_MS_PKI_CERTSTORE = 'application/vnd.ms-pki.certstore';
114 public const APPLICATION__VND_MS_PKI_PKO = 'application/vnd.ms-pki.pko';
115 public const APPLICATION__VND_MS_PKI_SECCAT = 'application/vnd.ms-pki.seccat';
116 public const APPLICATION__VND_MS_PKI_STL = 'application/vnd.ms-pki.stl';
117 public const APPLICATION__VND_MS_POWERPOINT = 'application/vnd.ms-powerpoint';
118 public const APPLICATION__VND_MS_PROJECT = 'application/vnd.ms-project';
119 public const APPLICATION__VND_NOKIA_CONFIGURATION_MESSAGE = 'application/vnd.nokia.configuration-message';
120 public const APPLICATION__VND_NOKIA_RINGING_TONE = 'application/vnd.nokia.ringing-tone';
121 public const APPLICATION__VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML_PRESENTATION = 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
122 public const APPLICATION__VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML_SLIDE = 'application/vnd.openxmlformats-officedocument.presentationml.slide';
123 public const APPLICATION__VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML_SLIDESHOW = 'application/vnd.openxmlformats-officedocument.presentationml.slideshow';
124 public const APPLICATION__VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML_TEMPLATE = 'application/vnd.openxmlformats-officedocument.presentationml.template';
125 public const APPLICATION__VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_SHEET = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
126 public const APPLICATION__VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_TEMPLATE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.template';
127 public const APPLICATION__VND_OPENXMLFORMATS_OFFICEDOCUMENT_WORDPROCESSINGML_DOCUMENT = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
128 public const APPLICATION__VND_OPENXMLFORMATS_OFFICEDOCUMENT_WORDPROCESSINGML_TEMPLATE = 'application/vnd.openxmlformats-officedocument.wordprocessingml.template';
129 public const APPLICATION__VND_RN_REALMEDIA = 'application/vnd.rn-realmedia';
130 public const APPLICATION__VND_RN_REALPLAYER = 'application/vnd.rn-realplayer';
131 public const APPLICATION__VND_WAP_WMLC = 'application/vnd.wap.wmlc';
132 public const APPLICATION__VND_WAP_WMLSCRIPTC = 'application/vnd.wap.wmlscriptc';
133 public const APPLICATION__VND_XARA = 'application/vnd.xara';
134 public const APPLICATION__VOCALTEC_MEDIA_DESC = 'application/vocaltec-media-desc';
135 public const APPLICATION__VOCALTEC_MEDIA_FILE = 'application/vocaltec-media-file';
136 public const APPLICATION__WORDPERFECT = 'application/wordperfect';
137 public const APPLICATION__WORDPERFECT6_0 = 'application/wordperfect6.0';
138 public const APPLICATION__WORDPERFECT6_1 = 'application/wordperfect6.1';
139 public const APPLICATION__XHTML_XML = 'application/xhtml+xml';
140 public const APPLICATION__XML = 'application/xml';
141 public const APPLICATION__X_123 = 'application/x-123';
142 public const APPLICATION__X_AIM = 'application/x-aim';
143 public const APPLICATION__X_AUTHORWARE_BIN = 'application/x-authorware-bin';
144 public const APPLICATION__X_AUTHORWARE_MAP = 'application/x-authorware-map';
145 public const APPLICATION__X_AUTHORWARE_SEG = 'application/x-authorware-seg';
146 public const APPLICATION__X_BCPIO = 'application/x-bcpio';
147 public const APPLICATION__X_BINARY = 'application/x-binary';
148 public const APPLICATION__X_BINHEX40 = 'application/x-binhex40';
149 public const APPLICATION__X_BSH = 'application/x-bsh';
150 public const APPLICATION__X_BYTECODE_PYTHON = 'application/x-bytecode.python';
151 public const APPLICATION__X_BZIP = 'application/x-bzip';
152 public const APPLICATION__X_BZIP2 = 'application/x-bzip2';
153 public const APPLICATION__X_CDF = 'application/x-cdf';
154 public const APPLICATION__X_CDLINK = 'application/x-cdlink';
155 public const APPLICATION__X_CHAT = 'application/x-chat';
156 public const APPLICATION__X_CMU_RASTER = 'application/x-cmu-raster';
157 public const APPLICATION__X_COCOA = 'application/x-cocoa';
158 public const APPLICATION__X_COMPACTPRO = 'application/x-compactpro';
159 public const APPLICATION__X_COMPRESS = 'application/x-compress';
160 public const APPLICATION__X_COMPRESSED = 'application/x-compressed';
161 public const APPLICATION__X_CONFERENCE = 'application/x-conference';
162 public const APPLICATION__X_CPIO = 'application/x-cpio';
163 public const APPLICATION__X_CPT = 'application/x-cpt';
164 public const APPLICATION__X_CSH = 'application/x-csh';
165 public const APPLICATION__X_DEEPV = 'application/x-deepv';
166 public const APPLICATION__X_DIRECTOR = 'application/x-director';
167 public const APPLICATION__X_DVI = 'application/x-dvi';
168 public const APPLICATION__X_ELC = 'application/x-elc';
169 public const APPLICATION__X_ENVOY = 'application/x-envoy';
170 public const APPLICATION__X_ESREHBER = 'application/x-esrehber';
171 public const APPLICATION__X_EXCEL = 'application/x-excel';
172 public const APPLICATION__X_FRAME = 'application/x-frame';
173 public const APPLICATION__X_FREELANCE = 'application/x-freelance';
174 public const APPLICATION__X_GSP = 'application/x-gsp';
175 public const APPLICATION__X_GSS = 'application/x-gss';
176 public const APPLICATION__X_GTAR = 'application/x-gtar';
177 public const APPLICATION__X_GZIP = 'application/x-gzip';
178 public const APPLICATION__X_HDF = 'application/x-hdf';
179 public const APPLICATION__X_HELPFILE = 'application/x-helpfile';
180 public const APPLICATION__X_HTTPD_IMAP = 'application/x-httpd-imap';
181 public const APPLICATION__X_IMA = 'application/x-ima';
182 public const APPLICATION__X_INTERNETT_SIGNUP = 'application/x-internett-signup';
183 public const APPLICATION__X_INVENTOR = 'application/x-inventor';
184 public const APPLICATION__X_IP2 = 'application/x-ip2';
185 public const APPLICATION__X_JAVASCRIPT = 'application/x-javascript';
186 public const APPLICATION__X_JAVA_APPLET = 'application/x-java-applet';
187 public const APPLICATION__X_JAVA_CLASS = 'application/x-java-class';
188 public const APPLICATION__X_JAVA_COMMERCE = 'application/x-java-commerce';
189 public const APPLICATION__X_KOAN = 'application/x-koan';
190 public const APPLICATION__X_KSH = 'application/x-ksh';
191 public const APPLICATION__X_LATEX = 'application/x-latex';
192 public const APPLICATION__X_LHA = 'application/x-lha';
193 public const APPLICATION__X_LISP = 'application/x-lisp';
194 public const APPLICATION__X_LIVESCREEN = 'application/x-livescreen';
195 public const APPLICATION__X_LOTUS = 'application/x-lotus';
196 public const APPLICATION__X_LOTUSSCREENCAM = 'application/x-lotusscreencam';
197 public const APPLICATION__X_LZH = 'application/x-lzh';
198 public const APPLICATION__X_LZX = 'application/x-lzx';
199 public const APPLICATION__X_MACBINARY = 'application/x-macbinary';
200 public const APPLICATION__X_MAC_BINHEX40 = 'application/x-mac-binhex40';
201 public const APPLICATION__X_MAGIC_CAP_PACKAGE_1_0 = 'application/x-magic-cap-package-1.0';
202 public const APPLICATION__X_MATHCAD = 'application/x-mathcad';
203 public const APPLICATION__X_MOBI = 'application/x-mobipocket-ebook';
204 public const APPLICATION__X_MEME = 'application/x-meme';
205 public const APPLICATION__X_MIDI = 'application/x-midi';
206 public const APPLICATION__X_MIF = 'application/x-mif';
207 public const APPLICATION__X_MIX_TRANSFER = 'application/x-mix-transfer';
208 public const APPLICATION__X_MPLAYER2 = 'application/x-mplayer2';
209 public const APPLICATION__X_MSEXCEL = 'application/x-msexcel';
210 public const APPLICATION__X_MSPOWERPOINT = 'application/x-mspowerpoint';
211 public const APPLICATION__X_NAVIDOC = 'application/x-navidoc';
212 public const APPLICATION__X_NAVIMAP = 'application/x-navimap';
213 public const APPLICATION__X_NAVISTYLE = 'application/x-navistyle';
214 public const APPLICATION__X_NAVI_ANIMATION = 'application/x-navi-animation';
215 public const APPLICATION__X_NETCDF = 'application/x-netcdf';
216 public const APPLICATION__X_NEWTON_COMPATIBLE_PKG = 'application/x-newton-compatible-pkg';
217 public const APPLICATION__X_NOKIA_9000_COMMUNICATOR_ADD_ON_SOFTWARE = 'application/x-nokia-9000-communicator-add-on-software';
218 public const APPLICATION__X_OMC = 'application/x-omc';
219 public const APPLICATION__X_OMCDATAMAKER = 'application/x-omcdatamaker';
220 public const APPLICATION__X_OMCREGERATOR = 'application/x-omcregerator';
221 public const APPLICATION__X_PAGEMAKER = 'application/x-pagemaker';
222 public const APPLICATION__X_PCL = 'application/x-pcl';
223 public const APPLICATION__X_PIXCLSCRIPT = 'application/x-pixclscript';
224 public const APPLICATION__X_PKCS10 = 'application/x-pkcs10';
225 public const APPLICATION__X_PKCS12 = 'application/x-pkcs12';
226 public const APPLICATION__X_PKCS7_CERTIFICATES = 'application/x-pkcs7-certificates';
227 public const APPLICATION__X_PKCS7_CERTREQRESP = 'application/x-pkcs7-certreqresp';
228 public const APPLICATION__X_PKCS7_MIME = 'application/x-pkcs7-mime';
229 public const APPLICATION__X_PKCS7_SIGNATURE = 'application/x-pkcs7-signature';
230 public const APPLICATION__X_POINTPLUS = 'application/x-pointplus';
231 public const APPLICATION__X_PORTABLE_ANYMAP = 'application/x-portable-anymap';
232 public const APPLICATION__X_PROJECT = 'application/x-project';
233 public const APPLICATION__X_QPRO = 'application/x-qpro';
234 public const APPLICATION__X_RTF = 'application/x-rtf';
235 public const APPLICATION__X_SDP = 'application/x-sdp';
236 public const APPLICATION__X_SEA = 'application/x-sea';
237 public const APPLICATION__X_SEELOGO = 'application/x-seelogo';
238 public const APPLICATION__X_SH = 'application/x-sh';
239 public const APPLICATION__X_SHAR = 'application/x-shar';
240 public const APPLICATION__X_SHOCKWAVE_FLASH = 'application/x-shockwave-flash';
241 public const APPLICATION__X_SIT = 'application/x-sit';
242 public const APPLICATION__X_SPRITE = 'application/x-sprite';
243 public const APPLICATION__X_STUFFIT = 'application/x-stuffit';
244 public const APPLICATION__X_SV4CPIO = 'application/x-sv4cpio';
245 public const APPLICATION__X_SV4CRC = 'application/x-sv4crc';
246 public const APPLICATION__X_TAR = 'application/x-tar';
247 public const APPLICATION__X_TBOOK = 'application/x-tbook';
248 public const APPLICATION__X_TCL = 'application/x-tcl';
249 public const APPLICATION__X_TEX = 'application/x-tex';
250 public const APPLICATION__X_TEXINFO = 'application/x-texinfo';
251 public const APPLICATION__X_TROFF = 'application/x-troff';
252 public const APPLICATION__X_TROFF_MAN = 'application/x-troff-man';
253 public const APPLICATION__X_TROFF_ME = 'application/x-troff-me';
254 public const APPLICATION__X_TROFF_MS = 'application/x-troff-ms';
255 public const APPLICATION__X_TROFF_MSVIDEO = 'application/x-troff-msvideo';
256 public const APPLICATION__X_USTAR = 'application/x-ustar';
257 public const APPLICATION__X_VISIO = 'application/x-visio';
258 public const APPLICATION__X_VND_AUDIOEXPLOSION_MZZ = 'application/x-vnd.audioexplosion.mzz';
259 public const APPLICATION__X_VND_LS_XPIX = 'application/x-vnd.ls-xpix';
260 public const APPLICATION__X_VRML = 'application/x-vrml';
261 public const APPLICATION__X_WAIS_SOURCE = 'application/x-wais-source';
262 public const APPLICATION__X_WINHELP = 'application/x-winhelp';
263 public const APPLICATION__X_WINTALK = 'application/x-wintalk';
264 public const APPLICATION__X_WORLD = 'application/x-world';
265 public const APPLICATION__X_WPWIN = 'application/x-wpwin';
266 public const APPLICATION__X_WRI = 'application/x-wri';
267 public const APPLICATION__X_X509_CA_CERT = 'application/x-x509-ca-cert';
268 public const APPLICATION__X_X509_USER_CERT = 'application/x-x509-user-cert';
269 public const APPLICATION__X_ZIP_COMPRESSED = 'application/x-zip-compressed';
270 public const APPLICATION__ZIP = 'application/zip';
271 public const AUDIO__AIFF = 'audio/aiff';
272 public const AUDIO__BASIC = 'audio/basic';
273 public const AUDIO__IT = 'audio/it';
274 public const AUDIO__MAKE = 'audio/make';
275 public const AUDIO__MAKE_MY_FUNK = 'audio/make.my.funk';
276 public const AUDIO__MID = 'audio/mid';
277 public const AUDIO__MIDI = 'audio/midi';
278 public const AUDIO__MOD = 'audio/mod';
279 public const AUDIO__MP4 = 'audio/mp4';
280 public const AUDIO__MPEG = 'audio/mpeg';
281 public const AUDIO__MPEG3 = 'audio/mpeg3';
282 public const AUDIO__NSPAUDIO = 'audio/nspaudio';
283 public const AUDIO__OGG = 'audio/ogg';
284 public const AUDIO__S3M = 'audio/s3m';
285 public const AUDIO__TSPLAYER = 'audio/tsplayer';
286 public const AUDIO__TSP_AUDIO = 'audio/tsp-audio';
287 public const AUDIO__VND_QCELP = 'audio/vnd.qcelp';
288 public const AUDIO__VOC = 'audio/voc';
289 public const AUDIO__VOXWARE = 'audio/voxware';
290 public const AUDIO__WAV = 'audio/wav';
291 public const AUDIO__XM = 'audio/xm';
292 public const AUDIO__X_ADPCM = 'audio/x-adpcm';
293 public const AUDIO__X_AIFF = 'audio/x-aiff';
294 public const AUDIO__X_AU = 'audio/x-au';
295 public const AUDIO__X_GSM = 'audio/x-gsm';
296 public const AUDIO__X_JAM = 'audio/x-jam';
297 public const AUDIO__X_LIVEAUDIO = 'audio/x-liveaudio';
298 public const AUDIO__X_MID = 'audio/x-mid';
299 public const AUDIO__X_MIDI = 'audio/x-midi';
300 public const AUDIO__X_MOD = 'audio/x-mod';
301 public const AUDIO__X_MPEG = 'audio/x-mpeg';
302 public const AUDIO__X_MPEG_3 = 'audio/x-mpeg-3';
303 public const AUDIO__X_MPEQURL = 'audio/x-mpequrl';
304 public const AUDIO__X_MS_WMA = 'audio/x-ms-wma';
305 public const AUDIO__X_NSPAUDIO = 'audio/x-nspaudio';
306 public const AUDIO__X_PN_REALAUDIO = 'audio/x-pn-realaudio';
307 public const AUDIO__X_PN_REALAUDIO_PLUGIN = 'audio/x-pn-realaudio-plugin';
308 public const AUDIO__X_PSID = 'audio/x-psid';
309 public const AUDIO__X_REALAUDIO = 'audio/x-realaudio';
310 public const AUDIO__X_TWINVQ = 'audio/x-twinvq';
311 public const AUDIO__X_TWINVQ_PLUGIN = 'audio/x-twinvq-plugin';
312 public const AUDIO__X_VND_AUDIOEXPLOSION_MJUICEMEDIAFILE = 'audio/x-vnd.audioexplosion.mjuicemediafile';
313 public const AUDIO__X_VOC = 'audio/x-voc';
314 public const AUDIO__X_WAV = 'audio/x-wav';
315 public const CHEMICAL__X_PDB = 'chemical/x-pdb';
316 public const IMAGE__ARW = 'image/ARW"';
317 public const IMAGE__BMP = 'image/bmp';
318 public const IMAGE__CMU_RASTER = 'image/cmu-raster';
319 public const IMAGE__CRW = 'image/CRW';
320 public const IMAGE__CR2 = 'image/CR2';
321 public const IMAGE__DNG = 'image/DNG';
322 public const IMAGE__FIF = 'image/fif';
323 public const IMAGE__FLORIAN = 'image/florian';
324 public const IMAGE__G3FAX = 'image/g3fax';
325 public const IMAGE__GIF = 'image/gif';
326 public const IMAGE__IEF = 'image/ief';
327 public const IMAGE__JPEG = 'image/jpeg';
328 public const IMAGE__JUTVISION = 'image/jutvision';
329 public const IMAGE__NAPLPS = 'image/naplps';
330 public const IMAGE__NEF = 'image/NEF';
331 public const IMAGE__PICT = 'image/pict';
332 public const IMAGE__PJPEG = 'image/pjpeg';
333 public const IMAGE__PNG = 'image/png';
334 public const IMAGE__SVG_XML = 'image/svg+xml';
335 public const IMAGE__TIFF = 'image/tiff';
336 public const IMAGE__VASA = 'image/vasa';
337 public const IMAGE__VND_DWG = 'image/vnd.dwg';
338 public const IMAGE__VND_FPX = 'image/vnd.fpx';
339 public const IMAGE__VND_NET_FPX = 'image/vnd.net-fpx';
340 public const IMAGE__VND_RN_REALFLASH = 'image/vnd.rn-realflash';
341 public const IMAGE__VND_RN_REALPIX = 'image/vnd.rn-realpix';
342 public const IMAGE__VND_WAP_WBMP = 'image/vnd.wap.wbmp';
343 public const IMAGE__VND_XIFF = 'image/vnd.xiff';
344 public const IMAGE__XBM = 'image/xbm';
345 public const IMAGE__XPM = 'image/xpm';
346 public const IMAGE__X_ADOBE_DNG = 'image/x-adobe-dng';
347 public const IMAGE__X_CANON_CRW = 'image/x-canon-crw';
348 public const IMAGE__X_CANON_CR2 = 'image/x-canon-cr2';
349 public const IMAGE__X_CMU_RASTER = 'image/x-cmu-raster';
350 public const IMAGE__X_DWG = 'image/x-dwg';
351 public const IMAGE__X_ICON = 'image/x-icon';
352 public const IMAGE__X_JG = 'image/x-jg';
353 public const IMAGE__X_JPS = 'image/x-jps';
354 public const IMAGE__X_MS_BMP = 'image/x-ms-bmp';
355 public const IMAGE__X_NIFF = 'image/x-niff';
356 public const IMAGE__X_NIKON_NEF = 'image/x-nikon-nef';
357 public const IMAGE__X_PCX = 'image/x-pcx';
358 public const IMAGE__X_PICT = 'image/x-pict';
359 public const IMAGE__X_PORTABLE_ANYMAP = 'image/x-portable-anymap';
360 public const IMAGE__X_PORTABLE_BITMAP = 'image/x-portable-bitmap';
361 public const IMAGE__X_PORTABLE_GRAYMAP = 'image/x-portable-graymap';
362 public const IMAGE__X_PORTABLE_GREYMAP = 'image/x-portable-greymap';
363 public const IMAGE__X_PORTABLE_PIXMAP = 'image/x-portable-pixmap';
364 public const IMAGE__X_QUICKTIME = 'image/x-quicktime';
365 public const IMAGE__X_RGB = 'image/x-rgb';
366 public const IMAGE__X_SONY_ARW = 'image/x-sony-arw';
367 public const IMAGE__X_TIFF = 'image/x-tiff';
368 public const IMAGE__X_WINDOWS_BMP = 'image/x-windows-bmp';
369 public const IMAGE__X_XBITMAP = 'image/x-xbitmap';
370 public const IMAGE__X_XBM = 'image/x-xbm';
371 public const IMAGE__X_XPIXMAP = 'image/x-xpixmap';
372 public const IMAGE__X_XWD = 'image/x-xwd';
373 public const IMAGE__X_XWINDOWDUMP = 'image/x-xwindowdump';
374 public const I_WORLD__I_VRML = 'i-world/i-vrml';
375 public const MESSAGE__RFC822 = 'message/rfc822';
376 public const MODEL__IGES = 'model/iges';
377 public const MODEL__VND_DWF = 'model/vnd.dwf';
378 public const MODEL__VRML = 'model/vrml';
379 public const MODEL__X_POV = 'model/x-pov';
380 public const MULTIPART__X_GZIP = 'multipart/x-gzip';
381 public const MULTIPART__X_USTAR = 'multipart/x-ustar';
382 public const MULTIPART__X_ZIP = 'multipart/x-zip';
383 public const MUSIC__CRESCENDO = 'music/crescendo';
384 public const MUSIC__X_KARAOKE = 'music/x-karaoke';
385 public const PALEOVU__X_PV = 'paleovu/x-pv';
386 public const TEXT__ASP = 'text/asp';
387 public const TEXT__CSS = 'text/css';
388 public const TEXT__CALENDAR = 'text/calendar';
389 public const TEXT__ECMASCRIPT = 'text/ecmascript';
390 public const TEXT__HTML = 'text/html';
391 public const TEXT__JAVASCRIPT = 'text/javascript';
392 public const TEXT__MARKDOWN = 'text/markdown';
393 public const TEXT__MCF = 'text/mcf';
394 public const TEXT__PASCAL = 'text/pascal';
395 public const TEXT__PLAIN = 'text/plain';
396 public const TEXT__RICHTEXT = 'text/richtext';
397 public const TEXT__SCRIPLET = 'text/scriplet';
398 public const TEXT__SGML = 'text/sgml';
399 public const TEXT__TAB_SEPARATED_VALUES = 'text/tab-separated-values';
400 public const TEXT__URI_LIST = 'text/uri-list';
401 public const TEXT__VND_ABC = 'text/vnd.abc';
402 public const TEXT__VND_FMI_FLEXSTOR = 'text/vnd.fmi.flexstor';
403 public const TEXT__VND_RN_REALTEXT = 'text/vnd.rn-realtext';
404 public const TEXT__VND_WAP_WML = 'text/vnd.wap.wml';
405 public const TEXT__VND_WAP_WMLSCRIPT = 'text/vnd.wap.wmlscript';
406 public const TEXT__VTT = 'text/vtt';
407 public const TEXT__WEBVIEWHTML = 'text/webviewhtml';
408 public const TEXT__XML = 'text/xml';
409 public const TEXT__X_ASM = 'text/x-asm';
410 public const TEXT__X_AUDIOSOFT_INTRA = 'text/x-audiosoft-intra';
411 public const TEXT__X_C = 'text/x-c';
412 public const TEXT__X_COMPONENT = 'text/x-component';
413 public const TEXT__X_FORTRAN = 'text/x-fortran';
414 public const TEXT__X_H = 'text/x-h';
415 public const TEXT__X_JAVA_SOURCE = 'text/x-java-source';
416 public const TEXT__X_LA_ASF = 'text/x-la-asf';
417 public const TEXT__X_M = 'text/x-m';
418 public const TEXT__X_PASCAL = 'text/x-pascal';
419 public const TEXT__X_SCRIPT = 'text/x-script';
420 public const TEXT__X_SCRIPT_CSH = 'text/x-script.csh';
421 public const TEXT__X_SCRIPT_ELISP = 'text/x-script.elisp';
422 public const TEXT__X_SCRIPT_GUILE = 'text/x-script.guile';
423 public const TEXT__X_SCRIPT_KSH = 'text/x-script.ksh';
424 public const TEXT__X_SCRIPT_LISP = 'text/x-script.lisp';
425 public const TEXT__X_SCRIPT_PERL = 'text/x-script.perl';
426 public const TEXT__X_SCRIPT_PERL_MODULE = 'text/x-script.perl-module';
427 public const TEXT__X_SCRIPT_PHYTON = 'text/x-script.phyton';
428 public const TEXT__X_SCRIPT_REXX = 'text/x-script.rexx';
429 public const TEXT__X_SCRIPT_SCHEME = 'text/x-script.scheme';
430 public const TEXT__X_SCRIPT_SH = 'text/x-script.sh';
431 public const TEXT__X_SCRIPT_TCL = 'text/x-script.tcl';
432 public const TEXT__X_SCRIPT_TCSH = 'text/x-script.tcsh';
433 public const TEXT__X_SCRIPT_ZSH = 'text/x-script.zsh';
434 public const TEXT__X_SERVER_PARSED_HTML = 'text/x-server-parsed-html';
435 public const TEXT__X_SETEXT = 'text/x-setext';
436 public const TEXT__X_SGML = 'text/x-sgml';
437 public const TEXT__X_SPEECH = 'text/x-speech';
438 public const TEXT__X_UIL = 'text/x-uil';
439 public const TEXT__X_UUENCODE = 'text/x-uuencode';
440 public const TEXT__X_VCALENDAR = 'text/x-vcalendar';
441 public const VIDEO__3_GPP = 'video/3gpp';
442 public const VIDEO__ANIMAFLEX = 'video/animaflex';
443 public const VIDEO__AVI = 'video/avi';
444 public const VIDEO__AVS_VIDEO = 'video/avs-video';
445 public const VIDEO__DL = 'video/dl';
446 public const VIDEO__FLI = 'video/fli';
447 public const VIDEO__GL = 'video/gl';
448 public const VIDEO__MPEG = 'video/mpeg';
449 public const VIDEO__MP4 = 'video/mp4';
450 public const VIDEO__MSVIDEO = 'video/msvideo';
451 public const VIDEO__OGG = 'video/ogg';
452 public const VIDEO__QUICKTIME = 'video/quicktime';
453 public const VIDEO__VDO = 'video/vdo';
454 public const VIDEO__VIMEO = 'video/vimeo';
455 public const VIDEO__VIVO = 'video/vivo';
456 public const VIDEO__VND_RN_REALVIDEO = 'video/vnd.rn-realvideo';
457 public const VIDEO__VND_VIVO = 'video/vnd.vivo';
458 public const VIDEO__VOSAIC = 'video/vosaic';
459 public const VIDEO__WEBM = 'video/webm';
460 public const VIDEO__X_AMT_DEMORUN = 'video/x-amt-demorun';
461 public const VIDEO__X_AMT_SHOWRUN = 'video/x-amt-showrun';
462 public const VIDEO__X_ATOMIC3D_FEATURE = 'video/x-atomic3d-feature';
463 public const VIDEO__X_DL = 'video/x-dl';
464 public const VIDEO__X_DV = 'video/x-dv';
465 public const VIDEO__X_FLI = 'video/x-fli';
466 public const VIDEO__X_FLV = 'video/x-flv';
467 public const VIDEO__X_GL = 'video/x-gl';
468 public const VIDEO__X_ISVIDEO = 'video/x-isvideo';
469 public const VIDEO__X_MOTION_JPEG = 'video/x-motion-jpeg';
470 public const VIDEO__X_MPEG = 'video/x-mpeg';
471 public const VIDEO__X_MPEQ2A = 'video/x-mpeq2a';
472 public const VIDEO__X_MSVIDEO = 'video/x-msvideo';
473 public const VIDEO__X_MS_ASF = 'video/x-ms-asf';
474 public const VIDEO__X_MS_ASF_PLUGIN = 'video/x-ms-asf-plugin';
475 public const VIDEO__X_MS_WM = 'video/x-ms-wm';
476 public const VIDEO__X_MS_WMD = 'video/x-ms-wmd';
477 public const VIDEO__X_MS_WMV = 'video/x-ms-wmv';
478 public const VIDEO__X_MS_WMX = 'video/x-ms-wmx';
479 public const VIDEO__X_MS_WMZ = 'video/x-ms-wmz';
480 public const VIDEO__X_MS_WVX = 'video/x-ms-wvx';
481 public const VIDEO__X_QTC = 'video/x-qtc';
482 public const VIDEO__X_SCM = 'video/x-scm';
483 public const VIDEO__X_SGI_MOVIE = 'video/x-sgi-movie';
484 public const VIDEO__YOUTUBE = 'video/youtube';
485 public const WINDOWS__METAFILE = 'windows/metafile';
486 public const WWW__MIME = 'www/mime';
487 public const XGL__DRAWING = 'xgl/drawing';
488 public const XGL__MOVIE = 'xgl/movie';
489 public const X_CONFERENCE__X_COOLTALK = 'x-conference/x-cooltalk';
490 public const X_MUSIC__X_MIDI = 'x-music/x-midi';
491 public const X_WORLD__X_3DMF = 'x-world/x-3dmf';
492 public const X_WORLD__X_SVR = 'x-world/x-svr';
493 public const X_WORLD__X_VRML = 'x-world/x-vrml';
494 public const X_WORLD__X_VRT = 'x-world/x-vrt';
495
496 protected string $path = '';
497 protected string $suffix = '';
498 protected bool $external = false;
500
501 protected function __construct(string $path_to_file)
502 {
504 if (str_contains($path_to_file, 'http://') || str_contains($path_to_file, 'https://')) {
505 $this->setExternal(true);
506 }
507 $parts = parse_url($path_to_file);
508 $this->setPath($path_to_file);
509 $this->setSuffix(pathinfo($parts['path'] ?? "", PATHINFO_EXTENSION));
510 }
511
515 public static function getExt2MimeMap(): array
516 {
518 $suffix_map = include "mime_type_map.php";
519 $map = [];
520 foreach ($suffix_map as $k => $v) {
521 $type = is_array($v) ? $v[0] : $v;
522 $map['.' . $k] = $type;
523 }
524
525 return $map;
526 }
527
532 public static function getMimeType(string $a_file = '', string $a_filename = '', string $a_mime = ''): string
533 {
534 $path = '';
535 if ($a_filename !== '' && $a_filename !== '0') {
536 $path = $a_filename;
537 } elseif ($a_file !== '' && $a_file !== '0') {
538 $path = $a_file;
539 }
540
541 return self::lookupMimeType($path, $a_mime);
542 }
543
544 public static function lookupMimeType(
545 string $path_to_file,
546 string $fallback = self::APPLICATION__OCTET_STREAM,
547 bool $a_external = false
548 ): string {
549 $obj = new self($path_to_file);
550 if ($a_external) {
551 $obj->setExternal($a_external);
552 }
553 $obj->setFallback($fallback);
554
555 return $obj->get();
556 }
557
558 public function get(): string
559 {
561 $suffix_map = include "mime_type_map.php";
562 if ($this->isExternal()) {
563 if (is_int(strpos($this->getPath(), 'youtube.')) ||
564 is_int(strpos($this->getPath(), 'youtu.be'))
565 ) {
566 return self::VIDEO__YOUTUBE;
567 }
568 if (is_int(strpos($this->getPath(), 'vimeo.'))) {
569 return self::VIDEO__VIMEO;
570 }
571 }
572 if ($this->getSuffix() !== '' && $this->getSuffix() !== '0' && isset($suffix_map[$this->getSuffix()])) {
573 if (!is_array($suffix_map[$this->getSuffix()])) {
574 return $suffix_map[$this->getSuffix()];
575 }
576 return $suffix_map[$this->getSuffix()][0];
577 }
578 if (extension_loaded('Fileinfo') && is_file($this->getPath())) {
579 $finfo = finfo_open(FILEINFO_MIME_TYPE);
580 $info = finfo_file($finfo, $this->getPath());
581 finfo_close($finfo);
582 if ($info) {
583 return $info;
584 }
585 }
586
587 return $this->getFallback();
588 }
589
590 protected function isExternal(): bool
591 {
592 return $this->external;
593 }
594
595 public function setExternal(bool $external): void
596 {
597 $this->external = $external;
598 }
599
600 protected function getPath(): string
601 {
602 return $this->path;
603 }
604
605 protected function setPath(string $path): void
606 {
607 $this->path = $path;
608 }
609
610 protected function getSuffix(): string
611 {
612 return $this->suffix;
613 }
614
615 protected function setSuffix(string $suffix): void
616 {
617 // see #18157
618 $this->suffix = strtolower($suffix);
619 }
620
621 protected function getFallback(): string
622 {
623 return $this->fallback;
624 }
625
626 public function setFallback(string $fallback): void
627 {
628 $this->fallback = $fallback;
629 }
630}
Mime type determination.
Definition: MimeType.php:30
setFallback(string $fallback)
Definition: MimeType.php:626
const APPLICATION__VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML_SLIDE
Definition: MimeType.php:122
const APPLICATION__X_PKCS7_CERTIFICATES
Definition: MimeType.php:226
setPath(string $path)
Definition: MimeType.php:605
__construct(string $path_to_file)
Definition: MimeType.php:501
const APPLICATION__VND_OPENXMLFORMATS_OFFICEDOCUMENT_WORDPROCESSINGML_TEMPLATE
Definition: MimeType.php:128
setSuffix(string $suffix)
Definition: MimeType.php:615
const APPLICATION__VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_TEMPLATE
Definition: MimeType.php:126
const APPLICATION__VOCALTEC_MEDIA_DESC
Definition: MimeType.php:134
static getMimeType(string $a_file='', string $a_filename='', string $a_mime='')
Definition: MimeType.php:532
const APPLICATION__VND_MS_EXCEL_ADDIN_MACRO_ENABLED_12
Definition: MimeType.php:111
const APPLICATION__VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML_PRESENTATION
Definition: MimeType.php:121
const APPLICATION__VND_NOKIA_CONFIGURATION_MESSAGE
Definition: MimeType.php:119
const APPLICATION__VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML_TEMPLATE
Definition: MimeType.php:124
const APPLICATION__VND_MS_POWERPOINT
Definition: MimeType.php:117
const AUDIO__X_VND_AUDIOEXPLOSION_MJUICEMEDIAFILE
Definition: MimeType.php:312
setExternal(bool $external)
Definition: MimeType.php:595
const APPLICATION__X_INTERNETT_SIGNUP
Definition: MimeType.php:182
const APPLICATION__X_VND_AUDIOEXPLOSION_MZZ
Definition: MimeType.php:258
const APPLICATION__X_NEWTON_COMPATIBLE_PKG
Definition: MimeType.php:216
const APPLICATION__VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML_SLIDESHOW
Definition: MimeType.php:123
const APPLICATION__X_MAGIC_CAP_PACKAGE_1_0
Definition: MimeType.php:201
const APPLICATION__VND_MS_PKI_SECCAT
Definition: MimeType.php:115
const APPLICATION__VND_NOKIA_RINGING_TONE
Definition: MimeType.php:120
const APPLICATION__VND_RN_REALPLAYER
Definition: MimeType.php:130
const APPLICATION__X_PORTABLE_ANYMAP
Definition: MimeType.php:231
const APPLICATION__VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_SHEET
Definition: MimeType.php:125
const APPLICATION__VND_MS_PKI_CERTSTORE
Definition: MimeType.php:113
const APPLICATION__PKCS7_SIGNATURE
Definition: MimeType.php:84
const APPLICATION__X_PKCS7_SIGNATURE
Definition: MimeType.php:229
const APPLICATION__X_BYTECODE_PYTHON
Definition: MimeType.php:150
const APPLICATION__X_SHOCKWAVE_FLASH
Definition: MimeType.php:240
const APPLICATION__X_PKCS7_CERTREQRESP
Definition: MimeType.php:227
const APPLICATION__X_NOKIA_9000_COMMUNICATOR_ADD_ON_SOFTWARE
Definition: MimeType.php:217
const APPLICATION__VND_OPENXMLFORMATS_OFFICEDOCUMENT_WORDPROCESSINGML_DOCUMENT
Definition: MimeType.php:127
const APPLICATION__VND_WAP_WMLSCRIPTC
Definition: MimeType.php:132
const APPLICATION__VOCALTEC_MEDIA_FILE
Definition: MimeType.php:135
const APPLICATION__VND_MS_EXCEL_SHEET_BINARY_MACRO_ENABLED_12
Definition: MimeType.php:112
static lookupMimeType(string $path_to_file, string $fallback=self::APPLICATION__OCTET_STREAM, bool $a_external=false)
Definition: MimeType.php:544
$info
Definition: entry_point.php:21
$path
Definition: ltiservices.php:30
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...