xref: /webtrees/app/Mime.php (revision 2e84ab20039c9d1e59e1b3c391771ea6d1d60554)
1<?php
2
3/**
4 * webtrees: online genealogy
5 * Copyright (C) 2020 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 <http://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/x-gedcom',
36        'gif'  => 'image/gif',
37        'flac' => 'audio/flac',
38        'htm'  => 'text/html',
39        'html' => 'text/html',
40        'ico'  => 'image/x-icon',
41        'jpe'  => 'image/jpeg',
42        'jpeg' => 'image/jpeg',
43        'jpg'  => 'image/jpeg',
44        'js'   => 'application/javascript',
45        'json' => 'application/json',
46        'mov'  => 'video/quicktime',
47        'mp3'  => 'audio/mpeg',
48        'mp4'  => 'video/mp4',
49        'oga'  => 'audio/ogg',
50        'ogg'  => 'audio/ogg',
51        'ogv'  => 'video/ogg',
52        'pdf'  => 'application/pdf',
53        'png'  => 'image/png',
54        'rar'  => 'application/x-rar-compressed',
55        'svg'  => 'image/svg',
56        'swf'  => 'application/x-shockwave-flash',
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