xref: /webtrees/app/Mime.php (revision ab2c91523aeb171fd76225844c6c3c0d2440dda3)
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        'MP3'  => 'audio/mpeg',
49        'MP4'  => 'video/mp4',
50        'OGA'  => 'audio/ogg',
51        'OGG'  => 'audio/ogg',
52        'OGV'  => 'video/ogg',
53        'PDF'  => 'application/pdf',
54        'PNG'  => 'image/png',
55        'RAR'  => 'application/x-rar-compressed',
56        'SVG'  => 'image/svg+xml',
57        'TIF'  => 'image/tiff',
58        'TIFF' => 'image/tiff',
59        'TXT'  => 'text/plain',
60        'WEBP' => 'image/webp',
61        'WMV'  => 'video/x-ms-wmv',
62        'XLS'  => 'application/vnd-ms-excel',
63        'XLSX' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
64        'XML'  => 'application/xml',
65        'ZIP'  => 'application/zip',
66    ];
67}
68