xref: /webtrees/app/Mime.php (revision ac71572d8462e396ed5a307f05b29381e49f9e6e)
1<?php
2
3/**
4 * webtrees: online genealogy
5 * Copyright (C) 2022 webtrees development team
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18declare(strict_types=1);
19
20namespace Fisharebest\Webtrees;
21
22/**
23 * A list of known or supported mime types
24 */
25class Mime
26{
27    public const DEFAULT_TYPE = 'application/octet-stream';
28
29    // Convert extension to mime-type
30    public const TYPES = [
31        'BMP'  => 'image/bmp',
32        'CSS'  => 'text/css',
33        'DOC'  => 'application/msword',
34        'DOCX' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
35        'GED'  => 'text/vnd.familysearch.gedcom',
36        'GIF'  => 'image/gif',
37        'FLAC' => 'audio/flac',
38        'HEIF' => 'image/heif',
39        'HTM'  => 'text/html',
40        'HTML' => 'text/html',
41        'ICO'  => 'image/x-icon',
42        'JPE'  => 'image/jpeg',
43        'JPEG' => 'image/jpeg',
44        'JPG'  => 'image/jpeg',
45        'JS'   => 'application/javascript',
46        'JSON' => 'application/json',
47        'MOV'  => 'video/quicktime',
48        'M4V'  => 'video/mp4',
49        'MKV'  => 'video/x-matroska',
50        'MP3'  => 'audio/mpeg',
51        'MP4'  => 'video/mp4',
52        'OGA'  => 'audio/ogg',
53        'OGG'  => 'audio/ogg',
54        'OGV'  => 'video/ogg',
55        'PDF'  => 'application/pdf',
56        'PNG'  => 'image/png',
57        'RAR'  => 'application/x-rar-compressed',
58        'SVG'  => 'image/svg+xml',
59        'TIF'  => 'image/tiff',
60        'TIFF' => 'image/tiff',
61        'TXT'  => 'text/plain',
62        'WEBM' => 'video/webm',
63        'WEBP' => 'image/webp',
64        'WMV'  => 'video/x-ms-wmv',
65        'XLS'  => 'application/vnd-ms-excel',
66        'XLSX' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
67        'XML'  => 'application/xml',
68        'ZIP'  => 'application/zip',
69    ];
70}
71