-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmime.js
More file actions
82 lines (81 loc) · 3.45 KB
/
Copy pathmime.js
File metadata and controls
82 lines (81 loc) · 3.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
function MIMEtype(ext) {
switch (ext) {
case '.aac' : return 'audio/aac';
case '.abw' : return 'application/x-abiword';
case '.arc' : return 'application/x-freearc';
case '.avi' : return 'video/x-msvideo';
case '.azw' : return 'application/vnd.amazon.ebook';
case '.bin' : return 'application/octet-stream';
case '.bmp' : return 'image/bmp';
case '.bz' : return 'application/x-bzip';
case '.bz2' : return 'application/x-bzip2';
case '.csh' : return 'application/x-csh';
case '.css' : return 'text/css';
case '.csv' : return 'text/csv';
case '.doc' : return 'application/msword';
case '.docx': return 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
case '.eot' : return 'application/vnd.ms-fontobject';
case '.epub': return 'application/epub+zip';
case '.gz' : return 'application-gzip';
case '.gif' : return 'image/gif';
case '.htm' :
case '.html': return 'text/html';
case '.ico' : return 'image/vnd.microsoft.icon';
case '.ics' : return 'text/calendar';
case '.jar' : return 'application/java-archive';
case '.jpeg':
case '.jpg' : return 'image/jpeg';
case '.js' : return 'text/javascript';
case '.json': return 'application/json';
case '.jsonld': return 'application/ld+json';
case '.mid' :
case '.midi': return 'audio/midi'; /* audio/x-midi */
case '.mjs' : return 'text/javascript';
case '.mp3' : return 'audio/mpeg';
case '.mpeg': return 'video/mpeg';
case '.mpkg': return 'application/vnd.apple.installer+xml';
case '.odp' : return 'application/vnd.oasis.opendocument.presentation';
case '.ods' : return 'application/vnd.oasis.opendocument.spreadsheet';
case '.odt' : return 'application/vnd.oasis.opendocument.text';
case '.oga' : return 'audio/ogg';
case '.ogv' : return 'video/ogg';
case '.ogx' : return 'application/ogg';
case '.opus': return 'audio/opus';
case '.otf' : return 'font/otf';
case '.png' : return 'image/png';
case '.pdf' : return 'application/pdf';
case '.php' : return 'application/x-httpd-php';
case '.ppt' : return 'application/vnd.ms-powerpoint';
case '.pptx': return 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
case '.rar' : return 'application/vnd.rar';
case '.rtf' : return 'application/rtf';
case '.sh' : return 'application/x-sh';
case '.svg' : return 'image/svg+xml';
case '.swf' : return 'application/x-shockwave-flash';
case '.tar' : return 'application/x-tar';
case '.tif' :
case '.tiff': return 'image/tiff';
case '.ts' : return 'video/mp2t';
case '.ttf' : return 'font/ttf';
case '.txt' : return 'text/plain';
case '.vsd' : return 'application/vnd.visio';
case '.wav' : return 'audio/wav';
case '.wasm': return 'application/wasm';
case '.weba': return 'audio/webm';
case '.webm': return 'video/webm';
case '.webp': return 'image/webp';
case '.woff': return 'font/woff';
case '.woff2': return 'font/woff2';
case '.xhtml': return 'application/xhtml+xml';
case '.xls' : return 'application/vnd.ms-excel';
case '.xlsx': return 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
case '.xml' : return 'application/xml'; /* text/xml */
case '.xul' : return 'application/vnd.mozilla.xul+xml';
case '.zip' : return 'application/zip';
case '.3gp' : return 'video/3gpp'; /* audio/3gpp */
case '.3g2' : return 'video/3gpp2'; /* audio/3gpp2 */
case '.7z' : return 'application/x-7z-compressed';
default: return 'application/octet-stream';
}
}
module.exports = MIMEtype;