MIME-типы
MIME (Multipurpose Internet Mail Extension, Многоцелевые расширения почты Интернета) — спецификация для передачи по сети файлов различного типа: изображений, музыки, текстов, видео, архивов и др. Указание MIME-типа используется в HTML обычно при передаче данных форм и вставки на страницу различных объектов.
Некоторые популярные MIME-типы и расширения файлов с ними связанных приведены в табл. 1.
Табл. 1. MIME-типы
| Расширение файла |
Тип данных |
| ai |
application/postscript |
| aif |
audio/aiff |
| aif |
audio/x-aiff |
| aiff |
audio/aiff |
| aiff |
audio/x-aiff |
| ani |
application/x-navi-animation |
| aos |
application/x-nokia-9000-communicator-add-on-software |
| aps |
application/mime |
| arc |
application/octet-stream |
| arj |
application/arj |
| arj |
application/octet-stream |
| art |
image/x-jg |
| asf |
video/x-ms-asf |
| asm |
text/x-asm |
| asp |
text/asp |
| asx |
application/x-mplayer2 |
| asx |
video/x-ms-asf |
| asx |
video/x-ms-asf-plugin |
| au |
audio/basic |
| au |
audio/x-au |
| avi |
application/x-troff-msvideo |
| avi |
video/avi |
| avi |
video/msvideo |
| avi |
video/x-msvideo |
| bin |
application/mac-binary |
| bin |
application/macbinary |
| bin |
application/octet-stream |
| bin |
application/x-binary |
| bin |
application/x-macbinary |
| bm |
image/bmp |
| bmp |
image/bmp |
| bmp |
image/x-windows-bmp |
| boo |
application/book |
| book |
application/book |
| c |
text/x-c |
| c++ |
text/plain |
| ccad |
application/clariscad |
| class |
application/java |
| class |
application/java-byte-code |
| class |
application/x-java-class |
| com |
application/octet-stream |
| com |
text/plain |
| conf |
text/plain |
| cpp |
text/x-c |
| cpt |
application/mac-compactpro |
| cpt |
application/x-compactpro |
| cpt |
application/x-cpt |
| css |
application/x-pointplus |
| css |
text/css |
| dcr |
application/x-director |
| def |
text/plain |
| dif |
video/x-dv |
| dir |
application/x-director |
| dl |
video/dl |
| dl |
video/x-dl |
| doc |
application/msword |
| dot |
application/msword |
| drw |
application/drafting |
| dvi |
application/x-dvi |
| dwg |
application/acad |
| dwg |
image/vnd.dwg |
| dwg |
image/x-dwg |
| dxf |
application/dxf |
| dxf |
image/vnd.dwg |
| dxf |
image/x-dwg |
| dxr |
application/x-director |
| exe |
application/octet-stream |
| gif |
image/gif |
| gz |
application/x-compressed |
| gz |
application/x-gzip |
| gzip |
application/x-gzip |
| gzip |
multipart/x-gzip |
| h |
text/plain |
| h |
text/x-h |
| hlp |
application/hlp |
| hlp |
application/x-helpfile |
| hlp |
application/x-winhelp |
| htc |
text/x-component |
| htm |
text/html |
| html |
text/html |
| htmls |
text/html |
| htt |
text/webviewhtml |
| ice |
x-conference/x-cooltalk |
| ico |
image/x-icon |
| inf |
application/inf |
| jam |
audio/x-jam |
| jav |
text/plain |
| jav |
text/x-java-source |
| java |
text/plain |
| java |
text/x-java-source |
| jcm |
application/x-java-commerce |
| jfif |
image/jpeg |
| jfif |
image/pjpeg |
| jfif-tbnl |
image/jpeg |
| jpe |
image/jpeg |
| jpe |
image/pjpeg |
| jpeg |
image/jpeg |
| jpeg |
image/pjpeg |
| jpg |
image/jpeg |
| jpg |
image/pjpeg |
| jps |
image/x-jps |
| js |
application/x-javascript |
| js |
application/javascript |
| js |
application/ecmascript |
| js |
text/javascript |
| js |
text/ecmascript |
| latex |
application/x-latex |
| lha |
application/lha |
| lha |
application/octet-stream |
| lha |
application/x-lha |
| lhx |
application/octet-stream |
| list |
text/plain |
| lsp |
application/x-lisp |
| lsp |
text/x-script.lisp |
| lst |
text/plain |
| lzh |
application/octet-stream |
| lzh |
application/x-lzh |
| lzx |
application/lzx |
| lzx |
application/octet-stream |
| lzx |
application/x-lzx |
| m3u |
audio/x-mpequrl |
| man |
application/x-troff-man |
| mid |
application/x-midi |
| mid |
audio/midi |
| mid |
audio/x-mid |
| mid |
audio/x-midi |
| mid |
music/crescendo |
| mid |
x-music/x-midi |
| midi |
application/x-midi |
| midi |
audio/midi |
| midi |
audio/x-mid |
| midi |
audio/x-midi |
| midi |
music/crescendo |
| midi |
x-music/x-midi |
| mod |
audio/mod |
| mod |
audio/x-mod |
| mov |
video/quicktime |
| movie |
video/x-sgi-movie |
| mp2 |
audio/mpeg |
| mp2 |
audio/x-mpeg |
| mp2 |
video/mpeg |
| mp2 |
video/x-mpeg |
| mp2 |
video/x-mpeq2a |
| mp3 |
audio/mpeg3 |
| mp3 |
audio/x-mpeg-3 |
| mp3 |
video/mpeg |
| mp3 |
video/x-mpeg |
| mp4 |
video/mp4 |
| mpa |
audio/mpeg |
| mpa |
video/mpeg |
| mpeg |
video/mpeg |
| mpg |
audio/mpeg |
| mpg |
video/mpeg |
| mpga |
audio/mpeg |
| pas |
text/pascal |
| pcl |
application/vnd.hp-pcl |
| pcl |
application/x-pcl |
| pct |
image/x-pict |
| pcx |
image/x-pcx |
| pdf |
application/pdf |
| pic |
image/pict |
| pict |
image/pict |
| pl |
text/plain |
| pl |
text/x-script.perl |
| pm |
image/x-xpixmap |
| pm |
text/x-script.perl-module |
| pm4 |
application/x-pagemaker |
| pm5 |
application/x-pagemaker |
| png |
image/png |
| pot |
application/mspowerpoint |
| pot |
application/vnd.ms-powerpoint |
| ppa |
application/vnd.ms-powerpoint |
| pps |
application/mspowerpoint |
| pps |
application/vnd.ms-powerpoint |
| ppt |
application/mspowerpoint |
| ppt |
application/powerpoint |
| ppt |
application/vnd.ms-powerpoint |
| ppt |
application/x-mspowerpoint |
| ppz |
application/mspowerpoint |
| ps |
application/postscript |
| psd |
application/octet-stream |
| pwz |
application/vnd.ms-powerpoint |
| py |
text/x-script.phyton |
| pyc |
applicaiton/x-bytecode.python |
| qt |
video/quicktime |
| qtif |
image/x-quicktime |
| ra |
audio/x-pn-realaudio |
| ra |
audio/x-pn-realaudio-plugin |
| ra |
audio/x-realaudio |
| ram |
audio/x-pn-realaudio |
| rm |
application/vnd.rn-realmedia |
| rm |
audio/x-pn-realaudio |
| rpm |
audio/x-pn-realaudio-plugin |
| rtf |
application/rtf |
| rtf |
application/x-rtf |
| rtf |
text/richtext |
| rtx |
application/rtf |
| rtx |
text/richtext |
| rv |
video/vnd.rn-realvideo |
| sgml |
text/sgml |
| sgml |
text/x-sgml |
| sh |
application/x-bsh |
| sh |
application/x-sh |
| sh |
application/x-shar |
| sh |
text/x-script.sh |
| shtml |
text/html |
| shtml |
text/x-server-parsed-html |
| ssi |
text/x-server-parsed-html |
| tar |
application/x-tar |
| tcl |
application/x-tcl |
| tcl |
text/x-script.tcl |
| text |
application/plain |
| text |
text/plain |
| tgz |
application/gnutar |
| tgz |
application/x-compressed |
| tif |
image/tiff |
| tif |
image/x-tiff |
| tiff |
image/tiff |
| tiff |
image/x-tiff |
| txt |
text/plain |
| uri |
text/uri-list |
| vcd |
application/x-cdlink |
| vmd |
application/vocaltec-media-desc |
| vrml |
application/x-vrml |
| vrml |
model/vrml |
| vrml |
x-world/x-vrml |
| vsd |
application/x-visio |
| vst |
application/x-visio |
| vsw |
application/x-visio |
| wav |
audio/wav |
| wav |
audio/x-wav |
| wmf |
windows/metafile |
| xla |
application/excel |
| xla |
application/x-excel |
| xla |
application/x-msexcel |
| xlb |
application/excel |
| xlb |
application/vnd.ms-excel |
| xlb |
application/x-excel |
| xlc |
application/excel |
| xlc |
application/vnd.ms-excel |
| xlc |
application/x-excel |
| xld |
application/excel |
| xld |
application/x-excel |
| xlk |
application/excel |
| xlk |
application/x-excel |
| xll |
application/excel |
| xll |
application/vnd.ms-excel |
| xll |
application/x-excel |
| xlm |
application/excel |
| xlm |
application/vnd.ms-excel |
| xlm |
application/x-excel |
| xls |
application/excel |
| xls |
application/vnd.ms-excel |
| xls |
application/x-excel |
| xls |
application/x-msexcel |
| xlt |
application/excel |
| xlt |
application/x-excel |
| xlv |
application/excel |
| xlv |
application/x-excel |
| xlw |
application/excel |
| xlw |
application/vnd.ms-excel |
| xlw |
application/x-excel |
| xlw |
application/x-msexcel |
| xm |
audio/xm |
| xml |
application/xml |
| xml |
text/xml |
| z |
application/x-compress |
| z |
application/x-compressed |
| zip |
application/x-compressed |
| zip |
application/x-zip-compressed |
| zip |
application/zip |
| zip |
multipart/x-zip |
Статьи по теме
Не выкладывайте свой код напрямую в комментариях, он отображается некорректно. Воспользуйтесь сервисом cssdeck.com или jsfiddle.net, сохраните код и в комментариях дайте на него ссылку. Так и результат сразу увидят.
Типы тегов

HTML5

Блочные элементы

Строчные элементы

Универсальные элементы

Нестандартные теги

Осуждаемые теги

Видео

Документ

Звук

Изображения

Объекты

Скрипты

Списки

Ссылки

Таблицы

Текст

Форматирование

Формы

Фреймы
What is a correct MIME type for .docx, .pptx, etc.?
@wmarbut Seems to provide the mime type to me. Tried it with a jpeg and got: image/jpeg; charset=binary , where image/jpeg is the mime type.
Sep 30, 2014 at 22:44
you may have look on them here: msdn.microsoft.com/en-us/library/ms775147.aspx
Oct 28, 2015 at 14:44
10 Answers 10
Here are the correct Microsoft Office MIME types for HTTP content streaming:
Extension MIME Type .doc application/msword .dot application/msword .docx application/vnd.openxmlformats-officedocument.wordprocessingml.document .dotx application/vnd.openxmlformats-officedocument.wordprocessingml.template .docm application/vnd.ms-word.document.macroEnabled.12 .dotm application/vnd.ms-word.template.macroEnabled.12 .xls application/vnd.ms-excel .xlt application/vnd.ms-excel .xla application/vnd.ms-excel .xlsx application/vnd.openxmlformats-officedocument.spreadsheetml.sheet .xltx application/vnd.openxmlformats-officedocument.spreadsheetml.template .xlsm application/vnd.ms-excel.sheet.macroEnabled.12 .xltm application/vnd.ms-excel.template.macroEnabled.12 .xlam application/vnd.ms-excel.addin.macroEnabled.12 .xlsb application/vnd.ms-excel.sheet.binary.macroEnabled.12 .ppt application/vnd.ms-powerpoint .pot application/vnd.ms-powerpoint .pps application/vnd.ms-powerpoint .ppa application/vnd.ms-powerpoint .pptx application/vnd.openxmlformats-officedocument.presentationml.presentation .potx application/vnd.openxmlformats-officedocument.presentationml.template .ppsx application/vnd.openxmlformats-officedocument.presentationml.slideshow .ppam application/vnd.ms-powerpoint.addin.macroEnabled.12 .pptm application/vnd.ms-powerpoint.presentation.macroEnabled.12 .potm application/vnd.ms-powerpoint.template.macroEnabled.12 .ppsm application/vnd.ms-powerpoint.slideshow.macroEnabled.12 .mdb application/vnd.ms-access
For further details check out this TechNet article and this blog post.
22.1k 13 13 gold badges 81 81 silver badges 109 109 bronze badges
answered Nov 18, 2010 at 8:32
Dirk Vollmar Dirk Vollmar
173k 53 53 gold badges 256 256 silver badges 316 316 bronze badges
This is maybe a little old, I use application/vnd.ms-excel for .xlsx
Jun 29, 2013 at 16:52
application/vnd.ms-excel is specifically for .xls files. the ability for it to work with .xlsx depends on the client software in use.
Nov 4, 2014 at 0:03
If one day there is a tutorial with example answers on how to answer, I would put this answer there.
Nov 24, 2016 at 7:47
Since no one else has said it: «application/vnd.openxmlformats-officedocument.wordprocessingml.document» — was that really necessary?!
Oct 17, 2017 at 19:33
Just look at MDN Web Docs for the Common MIME types
May 19, 2020 at 7:03
Here is an (almost) complete file extensions’s MIME in a JSON format.
You can do these examples: MIME[«ppt»] , MIME[«docx»] , etc
Edit:
According to @Octo Poulos suggestions:
- Separated jpeg and jpg MIME into two different keys
- updated the MIME of mp4 format to video/mp4
answered Jun 14, 2018 at 14:54
1,590 2 2 gold badges 17 17 silver badges 24 24 bronze badges
There are several mistakes here, for ex «mp4» should not be «application/mp4» but «video/mp4», and MIME[«jpeg»] will not work since the key is «jpeg, .jpg», same for «rss». Use at your own risk.
Jul 26, 2022 at 21:38
@OctoPoulos Thank you so much for your suggestions! As for the mp4 issue, I believe application/mp4 is not completely wrong. It depends on the use case of the file. However, thanks to your suggestion, I have updated it to the more frequent use case, video/mp4 . See stackoverflow.com/a/32441493/7069108 for more information about its use cases.
Jul 27, 2022 at 16:18
wow can you put this in an npm package or smth?
Sep 7, 2022 at 0:29
@AbrahamBrookes Thank you for being so enthusiastic! I believe many people have maturely developed NPM packages for such things. I’m afraid I couldn’t provide it as maturely as they do. But still, thank you for your support! xd
Sep 11, 2022 at 4:01
Great job friend
Sep 12, 2022 at 11:17
Alternatively, if you’re working in .NET v4.5 or above, try using System.Web.MimeMapping.GetMimeMapping (yourFileName) to get MIME types. It is much better than hard-coding strings.
UPDATE: In .Net Core, the same can be achieved using FileExtensionContentTypeProvider.TryGetContentType()
answered Jun 21, 2017 at 13:30
1,817 1 1 gold badge 16 16 silver badges 32 32 bronze badges
Well, considering that most apps expect to deal with just a handful of file types, I do not think using the API is much better than hard-coding the strings. It’s not like the MIMEs will change any time soon anyway. No need loading a truck of data into memory that you will never use.
Feb 25, 2018 at 14:50
There is no «right» answer — personally I just prefer to avoid hard-coding «magic strings» in my code and to be honest I’m too lazy to look them up each time when there’s a simple method that wraps it up nicely for me.
Feb 27, 2018 at 14:27
Per the documentation current as of when I am writing this (27 Aug 2021), located at link the MimeMapping.GetMimeMapping only applies to .NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 — so if we are in Core, we might look for another way.
Aug 27, 2021 at 19:44
This post will explore various approaches of fetching MIME Type across various programming languages with their CONS in one-line description as header. So, use them accordingly and the one which works for you.
For eg. the code below is especially helpful when user may supply either of .xls, .xlsx or .xlsm and you don’t want to write code testing extension and supplying MIME-type for each of them. Let the system do this job.
Python 3
Using python-magic
>>> pip install python-magic >>> import magic >>> magic.from_file("Employee.pdf", mime=True) 'application/pdf'
Using built-in mimeypes module — Map filenames to MimeTypes modules
>>> import mimetypes >>> mimetypes.init() >>> mimetypes.knownfiles ['/etc/mime.types', '/etc/httpd/mime.types', . ] >>> mimetypes.suffix_map['.tgz'] '.tar.gz' >>> mimetypes.encodings_map['.gz'] 'gzip' >>> mimetypes.types_map['.tgz'] 'application/x-tar-gz'
JAVA 7
Operating System dependent
@Test public void get_JAVA7_mimetype() < Path path = new File("Employee.xlsx").toPath(); String mimeType = Files.probeContentType(path); assertEquals(mimeType, "application/vnd.ms-excel"); >
It will use FileTypeDetector implementations to probe the MIME type and invokes the probeContentType of each implementation to resolve the type. Hence, if the file is known to the implementations then the content type is returned. However, if that doesn’t happen, a system-default file type detector is invoked.
Resolve using first few characters of the input stream
@Test public void getMIMEType_from_Extension() < File file = new File("Employee.xlsx"); String mimeType = URLConnection.guessContentTypeFromName(file.getName()); assertEquals(mimeType, "application/vnd.ms-excel"); >
Using built-in table of MIME types
@Test public void getMIMEType_UsingGetFileNameMap() < File file = new File("Employee.xlsx"); FileNameMap fileNameMap = URLConnection.getFileNameMap(); String mimeType = fileNameMap.getContentTypeFor(file.getName()); assertEquals(mimeType, "image/png"); >
It returns the matrix of MIME types used by all instances of URLConnection which then is used to resolve the input file type. However, this matrix of MIME types is very limited when it comes to URLConnection.
By default, the class uses content-types.properties file in JRE_HOME/lib. We can, however, extend it, by specifying a user-specific table using the content.types.user.table property:
System.setProperty("content.types.user.table","");
JavaScript
Interpret the Magic Number fetched using FileReader API
Final result looks something like this when one use javaScript to fetch the MimeType based on filestream. Open the embedded jsFiddle to see and understand this approach.
Bonus: It’s accessible for most of the MIME Types and also you can add custom Mime Types in the getMimetype function. Also, it has FULL SUPPORT for MS Office Files Mime Types.

The steps to calculate mime type for a file in this example would be:
- The user selects a file.
- Take the first 4 bytes of the file using the slice method.
- Create a new FileReader instance
- Use the FileReader to read the 4 bytes you sliced out as an array buffer.
- Since the array buffer is just a generic way to represent a binary buffer we need to create a TypedArray, in this case an Uint8Array.
- With a TypedArray at our hands we can retrieve every byte and transform it to hexadecimal (by using toString(16)).
- We now have a way to get the magic numbers from a file by reading the first four bytes. The final step is to map it to a real mime type.

Browser Support (Above 95% overall and Close to 100% in all modern browsers):

const uploads = [] const fileSelector = document.getElementById('file-selector') fileSelector.addEventListener('change', (event) => < console.time('FileOpen') const file = event.target.files[0] const filereader = new FileReader() filereader.onloadend = function(evt) < if (evt.target.readyState === FileReader.DONE) < const uint = new Uint8Array(evt.target.result) let bytes = [] uint.forEach((byte) =>< bytes.push(byte.toString(16)) >) const hex = bytes.join('').toUpperCase() uploads.push(< filename: file.name, filetype: file.type ? file.type : 'Unknown/Extension missing', binaryFileType: getMimetype(hex), hex: hex >) render() > console.timeEnd('FileOpen') > const blob = file.slice(0, 4); filereader.readAsArrayBuffer(blob); >) const render = () => < const container = document.getElementById('files') const uploadedFiles = uploads.map((file) => < return `$
$
$
$
` >) container.innerHTML = uploadedFiles.join('') > const getMimetype = (signature) => < switch (signature) < case '89504E47': return 'image/png' case '47494638': return 'image/gif' case '25504446': return 'application/pdf' case 'FFD8FFDB': case 'FFD8FFE0': case 'FFD8FFE1': return 'image/jpeg' case '504B0304': return 'application/zip' case '504B34': return 'application/vnd.ms-excel.sheet.macroEnabled.12' default: return 'Unknown filetype' >>
.result < font-family: Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif; line-height: 20px; font-size: 14px; margin: 10px 0; >.filename < color: #333; font-size: 16px; >.fileObject < color: #a53; >.binaryObject < color: #63f; >.HexCode < color: #262; >em < padding: 2px 4px; background-color: #efefef; font-style: normal; >input[type=file]
answered Dec 7, 2018 at 1:01
jainashish jainashish
4,762 5 5 gold badges 37 37 silver badges 48 48 bronze badges
A working method in android to populates the mapping list mime types.
private static void fileMimeTypeMapping() < MIMETYPE_MAPPING.put("3gp", Collections.list("video/3gpp")); MIMETYPE_MAPPING.put("7z", Collections.list("application/x-7z-compressed")); MIMETYPE_MAPPING.put("accdb", Collections.list("application/msaccess")); MIMETYPE_MAPPING.put("ai", Collections.list("application/illustrator")); MIMETYPE_MAPPING.put("apk", Collections.list("application/vnd.android.package-archive")); MIMETYPE_MAPPING.put("arw", Collections.list("image/x-dcraw")); MIMETYPE_MAPPING.put("avi", Collections.list("video/x-msvideo")); MIMETYPE_MAPPING.put("bash", Collections.list("text/x-shellscript")); MIMETYPE_MAPPING.put("bat", Collections.list("application/x-msdos-program")); MIMETYPE_MAPPING.put("blend", Collections.list("application/x-blender")); MIMETYPE_MAPPING.put("bin", Collections.list("application/x-bin")); MIMETYPE_MAPPING.put("bmp", Collections.list("image/bmp")); MIMETYPE_MAPPING.put("bpg", Collections.list("image/bpg")); MIMETYPE_MAPPING.put("bz2", Collections.list("application/x-bzip2")); MIMETYPE_MAPPING.put("cb7", Collections.list("application/x-cbr")); MIMETYPE_MAPPING.put("cba", Collections.list("application/x-cbr")); MIMETYPE_MAPPING.put("cbr", Collections.list("application/x-cbr")); MIMETYPE_MAPPING.put("cbt", Collections.list("application/x-cbr")); MIMETYPE_MAPPING.put("cbtc", Collections.list("application/x-cbr")); MIMETYPE_MAPPING.put("cbz", Collections.list("application/x-cbr")); MIMETYPE_MAPPING.put("cc", Collections.list("text/x-c")); MIMETYPE_MAPPING.put("cdr", Collections.list("application/coreldraw")); MIMETYPE_MAPPING.put("class", Collections.list("application/java")); MIMETYPE_MAPPING.put("cnf", Collections.list("text/plain")); MIMETYPE_MAPPING.put("conf", Collections.list("text/plain")); MIMETYPE_MAPPING.put("cpp", Collections.list("text/x-c++src")); MIMETYPE_MAPPING.put("cr2", Collections.list("image/x-dcraw")); MIMETYPE_MAPPING.put("css", Collections.list("text/css")); MIMETYPE_MAPPING.put("csv", Collections.list("text/csv")); MIMETYPE_MAPPING.put("cvbdl", Collections.list("application/x-cbr")); MIMETYPE_MAPPING.put("c", Collections.list("text/x-c")); MIMETYPE_MAPPING.put("c++", Collections.list("text/x-c++src")); MIMETYPE_MAPPING.put("dcr", Collections.list("image/x-dcraw")); MIMETYPE_MAPPING.put("deb", Collections.list("application/x-deb")); MIMETYPE_MAPPING.put("dng", Collections.list("image/x-dcraw")); MIMETYPE_MAPPING.put("doc", Collections.list("application/msword")); MIMETYPE_MAPPING.put("docm", Collections.list("application/vnd.ms-word.document.macroEnabled.12")); MIMETYPE_MAPPING.put("docx", Collections.list("application/vnd.openxmlformats-officedocument.wordprocessingml.document")); MIMETYPE_MAPPING.put("dot", Collections.list("application/msword")); MIMETYPE_MAPPING.put("dotx", Collections.list("application/vnd.openxmlformats-officedocument.wordprocessingml.template")); MIMETYPE_MAPPING.put("dv", Collections.list("video/dv")); MIMETYPE_MAPPING.put("eot", Collections.list("application/vnd.ms-fontobject")); MIMETYPE_MAPPING.put("epub", Collections.list("application/epub+zip")); MIMETYPE_MAPPING.put("eps", Collections.list("application/postscript")); MIMETYPE_MAPPING.put("erf", Collections.list("image/x-dcraw")); MIMETYPE_MAPPING.put("exe", Collections.list("application/x-ms-dos-executable")); MIMETYPE_MAPPING.put("flac", Collections.list("audio/flac")); MIMETYPE_MAPPING.put("flv", Collections.list("video/x-flv")); MIMETYPE_MAPPING.put("gif", Collections.list("image/gif")); MIMETYPE_MAPPING.put("gpx", Collections.list("application/gpx+xml")); MIMETYPE_MAPPING.put("gz", Collections.list("application/gzip")); MIMETYPE_MAPPING.put("gzip", Collections.list("application/gzip")); MIMETYPE_MAPPING.put("h", Collections.list("text/x-h")); MIMETYPE_MAPPING.put("heic", Collections.list("image/heic")); MIMETYPE_MAPPING.put("heif", Collections.list("image/heif")); MIMETYPE_MAPPING.put("hh", Collections.list("text/x-h")); MIMETYPE_MAPPING.put("hpp", Collections.list("text/x-h")); MIMETYPE_MAPPING.put("htaccess", Collections.list("text/plain")); MIMETYPE_MAPPING.put("ical", Collections.list("text/calendar")); MIMETYPE_MAPPING.put("ics", Collections.list("text/calendar")); MIMETYPE_MAPPING.put("iiq", Collections.list("image/x-dcraw")); MIMETYPE_MAPPING.put("impress", Collections.list("text/impress")); MIMETYPE_MAPPING.put("java", Collections.list("text/x-java-source")); MIMETYPE_MAPPING.put("jp2", Collections.list("image/jp2")); MIMETYPE_MAPPING.put("jpeg", Collections.list("image/jpeg")); MIMETYPE_MAPPING.put("jpg", Collections.list("image/jpeg")); MIMETYPE_MAPPING.put("jps", Collections.list("image/jpeg")); MIMETYPE_MAPPING.put("k25", Collections.list("image/x-dcraw")); MIMETYPE_MAPPING.put("kdc", Collections.list("image/x-dcraw")); MIMETYPE_MAPPING.put("key", Collections.list("application/x-iwork-keynote-sffkey")); MIMETYPE_MAPPING.put("keynote", Collections.list("application/x-iwork-keynote-sffkey")); MIMETYPE_MAPPING.put("kml", Collections.list("application/vnd.google-earth.kml+xml")); MIMETYPE_MAPPING.put("kmz", Collections.list("application/vnd.google-earth.kmz")); MIMETYPE_MAPPING.put("kra", Collections.list("application/x-krita")); MIMETYPE_MAPPING.put("ldif", Collections.list("text/x-ldif")); MIMETYPE_MAPPING.put("love", Collections.list("application/x-love-game")); MIMETYPE_MAPPING.put("lwp", Collections.list("application/vnd.lotus-wordpro")); MIMETYPE_MAPPING.put("m2t", Collections.list("video/mp2t")); MIMETYPE_MAPPING.put("m3u", Collections.list("audio/mpegurl")); MIMETYPE_MAPPING.put("m3u8", Collections.list("audio/mpegurl")); MIMETYPE_MAPPING.put("m4a", Collections.list("audio/mp4")); MIMETYPE_MAPPING.put("m4b", Collections.list("audio/m4b")); MIMETYPE_MAPPING.put("m4v", Collections.list("video/mp4")); MIMETYPE_MAPPING.put("markdown", Collections.list(MIMETYPE_TEXT_MARKDOWN)); MIMETYPE_MAPPING.put("mdown", Collections.list(MIMETYPE_TEXT_MARKDOWN)); MIMETYPE_MAPPING.put("md", Collections.list(MIMETYPE_TEXT_MARKDOWN)); MIMETYPE_MAPPING.put("mdb", Collections.list("application/msaccess")); MIMETYPE_MAPPING.put("mdwn", Collections.list(MIMETYPE_TEXT_MARKDOWN)); MIMETYPE_MAPPING.put("mkd", Collections.list(MIMETYPE_TEXT_MARKDOWN)); MIMETYPE_MAPPING.put("mef", Collections.list("image/x-dcraw")); MIMETYPE_MAPPING.put("mkv", Collections.list("video/x-matroska")); MIMETYPE_MAPPING.put("mobi", Collections.list("application/x-mobipocket-ebook")); MIMETYPE_MAPPING.put("mov", Collections.list("video/quicktime")); MIMETYPE_MAPPING.put("mp3", Collections.list("audio/mpeg")); MIMETYPE_MAPPING.put("mp4", Collections.list("video/mp4")); MIMETYPE_MAPPING.put("mpeg", Collections.list("video/mpeg")); MIMETYPE_MAPPING.put("mpg", Collections.list("video/mpeg")); MIMETYPE_MAPPING.put("mpo", Collections.list("image/jpeg")); MIMETYPE_MAPPING.put("msi", Collections.list("application/x-msi")); MIMETYPE_MAPPING.put("mts", Collections.list("video/MP2T")); MIMETYPE_MAPPING.put("mt2s", Collections.list("video/MP2T")); MIMETYPE_MAPPING.put("nef", Collections.list("image/x-dcraw")); MIMETYPE_MAPPING.put("numbers", Collections.list("application/x-iwork-numbers-sffnumbers")); MIMETYPE_MAPPING.put("odf", Collections.list("application/vnd.oasis.opendocument.formula")); MIMETYPE_MAPPING.put("odg", Collections.list("application/vnd.oasis.opendocument.graphics")); MIMETYPE_MAPPING.put("odp", Collections.list("application/vnd.oasis.opendocument.presentation")); MIMETYPE_MAPPING.put("ods", Collections.list("application/vnd.oasis.opendocument.spreadsheet")); MIMETYPE_MAPPING.put("odt", Collections.list("application/vnd.oasis.opendocument.text")); MIMETYPE_MAPPING.put("oga", Collections.list("audio/ogg")); MIMETYPE_MAPPING.put("ogg", Collections.list("audio/ogg")); MIMETYPE_MAPPING.put("ogv", Collections.list("video/ogg")); MIMETYPE_MAPPING.put("one", Collections.list("application/msonenote")); MIMETYPE_MAPPING.put("opus", Collections.list("audio/ogg")); MIMETYPE_MAPPING.put("orf", Collections.list("image/x-dcraw")); MIMETYPE_MAPPING.put("otf", Collections.list("application/font-sfnt")); MIMETYPE_MAPPING.put("pages", Collections.list("application/x-iwork-pages-sffpages")); MIMETYPE_MAPPING.put("pdf", Collections.list("application/pdf")); MIMETYPE_MAPPING.put("pfb", Collections.list("application/x-font")); MIMETYPE_MAPPING.put("pef", Collections.list("image/x-dcraw")); MIMETYPE_MAPPING.put("php", Collections.list("application/x-php")); MIMETYPE_MAPPING.put("pl", Collections.list("application/x-perl")); MIMETYPE_MAPPING.put("pls", Collections.list("audio/x-scpls")); MIMETYPE_MAPPING.put("png", Collections.list("image/png")); MIMETYPE_MAPPING.put("pot", Collections.list("application/vnd.ms-powerpoint")); MIMETYPE_MAPPING.put("potm", Collections.list("application/vnd.ms-powerpoint.template.macroEnabled.12")); MIMETYPE_MAPPING.put("potx", Collections.list("application/vnd.openxmlformats-officedocument.presentationml.template")); MIMETYPE_MAPPING.put("ppa", Collections.list("application/vnd.ms-powerpoint")); MIMETYPE_MAPPING.put("ppam", Collections.list("application/vnd.ms-powerpoint.addin.macroEnabled.12")); MIMETYPE_MAPPING.put("pps", Collections.list("application/vnd.ms-powerpoint")); MIMETYPE_MAPPING.put("ppsm", Collections.list("application/vnd.ms-powerpoint.slideshow.macroEnabled.12")); MIMETYPE_MAPPING.put("ppsx", Collections.list("application/vnd.openxmlformats-officedocument.presentationml.slideshow")); MIMETYPE_MAPPING.put("ppt", Collections.list("application/vnd.ms-powerpoint")); MIMETYPE_MAPPING.put("pptm", Collections.list("application/vnd.ms-powerpoint.presentation.macroEnabled.12")); MIMETYPE_MAPPING.put("pptx", Collections.list("application/vnd.openxmlformats-officedocument.presentationml.presentation")); MIMETYPE_MAPPING.put("ps", Collections.list("application/postscript")); MIMETYPE_MAPPING.put("psd", Collections.list("application/x-photoshop")); MIMETYPE_MAPPING.put("py", Collections.list("text/x-python")); MIMETYPE_MAPPING.put("raf", Collections.list("image/x-dcraw")); MIMETYPE_MAPPING.put("rar", Collections.list("application/x-rar-compressed")); MIMETYPE_MAPPING.put("reveal", Collections.list("text/reveal")); MIMETYPE_MAPPING.put("rss", Collections.list("application/rss+xml")); MIMETYPE_MAPPING.put("rtf", Collections.list("application/rtf")); MIMETYPE_MAPPING.put("rw2", Collections.list("image/x-dcraw")); MIMETYPE_MAPPING.put("schema", Collections.list("text/plain")); MIMETYPE_MAPPING.put("sgf", Collections.list("application/sgf")); MIMETYPE_MAPPING.put("sh-lib", Collections.list("text/x-shellscript")); MIMETYPE_MAPPING.put("sh", Collections.list("text/x-shellscript")); MIMETYPE_MAPPING.put("srf", Collections.list("image/x-dcraw")); MIMETYPE_MAPPING.put("sr2", Collections.list("image/x-dcraw")); MIMETYPE_MAPPING.put("tar", Collections.list("application/x-tar")); MIMETYPE_MAPPING.put("tar.bz2", Collections.list("application/x-bzip2")); MIMETYPE_MAPPING.put("tar.gz", Collections.list("application/x-compressed")); MIMETYPE_MAPPING.put("tbz2", Collections.list("application/x-bzip2")); MIMETYPE_MAPPING.put("tcx", Collections.list("application/vnd.garmin.tcx+xml")); MIMETYPE_MAPPING.put("tex", Collections.list("application/x-tex")); MIMETYPE_MAPPING.put("tgz", Collections.list("application/x-compressed")); MIMETYPE_MAPPING.put("tiff", Collections.list("image/tiff")); MIMETYPE_MAPPING.put("tif", Collections.list("image/tiff")); MIMETYPE_MAPPING.put("ttf", Collections.list("application/font-sfnt")); MIMETYPE_MAPPING.put("txt", Collections.list("text/plain")); MIMETYPE_MAPPING.put("vcard", Collections.list("text/vcard")); MIMETYPE_MAPPING.put("vcf", Collections.list("text/vcard")); MIMETYPE_MAPPING.put("vob", Collections.list("video/dvd")); MIMETYPE_MAPPING.put("vsd", Collections.list("application/vnd.visio")); MIMETYPE_MAPPING.put("vsdm", Collections.list("application/vnd.ms-visio.drawing.macroEnabled.12")); MIMETYPE_MAPPING.put("vsdx", Collections.list("application/vnd.ms-visio.drawing")); MIMETYPE_MAPPING.put("vssm", Collections.list("application/vnd.ms-visio.stencil.macroEnabled.12")); MIMETYPE_MAPPING.put("vssx", Collections.list("application/vnd.ms-visio.stencil")); MIMETYPE_MAPPING.put("vstm", Collections.list("application/vnd.ms-visio.template.macroEnabled.12")); MIMETYPE_MAPPING.put("vstx", Collections.list("application/vnd.ms-visio.template")); MIMETYPE_MAPPING.put("wav", Collections.list("audio/wav")); MIMETYPE_MAPPING.put("webm", Collections.list("video/webm")); MIMETYPE_MAPPING.put("woff", Collections.list("application/font-woff")); MIMETYPE_MAPPING.put("wpd", Collections.list("application/vnd.wordperfect")); MIMETYPE_MAPPING.put("wmv", Collections.list("video/x-ms-wmv")); MIMETYPE_MAPPING.put("xcf", Collections.list("application/x-gimp")); MIMETYPE_MAPPING.put("xla", Collections.list("application/vnd.ms-excel")); MIMETYPE_MAPPING.put("xlam", Collections.list("application/vnd.ms-excel.addin.macroEnabled.12")); MIMETYPE_MAPPING.put("xls", Collections.list("application/vnd.ms-excel")); MIMETYPE_MAPPING.put("xlsb", Collections.list("application/vnd.ms-excel.sheet.binary.macroEnabled.12")); MIMETYPE_MAPPING.put("xlsm", Collections.list("application/vnd.ms-excel.sheet.macroEnabled.12")); MIMETYPE_MAPPING.put("xlsx", Collections.list("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")); MIMETYPE_MAPPING.put("xlt", Collections.list("application/vnd.ms-excel")); MIMETYPE_MAPPING.put("xltm", Collections.list("application/vnd.ms-excel.template.macroEnabled.12")); MIMETYPE_MAPPING.put("xltx", Collections.list("application/vnd.openxmlformats-officedocument.spreadsheetml.template")); MIMETYPE_MAPPING.put("xrf", Collections.list("image/x-dcraw")); MIMETYPE_MAPPING.put("yaml", Arrays.asList("application/yaml", "text/plain")); MIMETYPE_MAPPING.put("yml", Arrays.asList("application/yaml", "text/plain")); MIMETYPE_MAPPING.put("zip", Collections.list("application/zip")); MIMETYPE_MAPPING.put("url", Collections.list("application/internet-shortcut")); MIMETYPE_MAPPING.put("webloc", Collections.list("application/internet-shortcut")); MIMETYPE_MAPPING.put("js", Arrays.asList("application/javascript", "text/plain")); MIMETYPE_MAPPING.put("json", Arrays.asList("application/json", "text/plain")); MIMETYPE_MAPPING.put("fb2", Arrays.asList("application/x-fictionbook+xml", "text/plain")); MIMETYPE_MAPPING.put("html", Arrays.asList("text/html", "text/plain")); MIMETYPE_MAPPING.put("htm", Arrays.asList("text/html", "text/plain")); MIMETYPE_MAPPING.put("m", Arrays.asList("text/x-matlab", "text/plain")); MIMETYPE_MAPPING.put("svg", Arrays.asList("image/svg+xml", "text/plain")); MIMETYPE_MAPPING.put("swf", Arrays.asList("application/x-shockwave-flash", "application/octet-stream")); MIMETYPE_MAPPING.put("xml", Arrays.asList("application/xml", "text/plain")); >
answered Nov 13, 2019 at 18:45
3,976 39 39 silver badges 35 35 bronze badges
In case anyone wants the answer of Dirk Vollmar in a C# switch statement:
case "doc": return "application/msword"; case "dot": return "application/msword"; case "docx": return "application/vnd.openxmlformats-officedocument.wordprocessingml.document"; case "dotx": return "application/vnd.openxmlformats-officedocument.wordprocessingml.template"; case "docm": return "application/vnd.ms-word.document.macroEnabled.12"; case "dotm": return "application/vnd.ms-word.template.macroEnabled.12"; case "xls": return "application/vnd.ms-excel"; case "xlt": return "application/vnd.ms-excel"; case "xla": return "application/vnd.ms-excel"; case "xlsx": return "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; case "xltx": return "application/vnd.openxmlformats-officedocument.spreadsheetml.template"; case "xlsm": return "application/vnd.ms-excel.sheet.macroEnabled.12"; case "xltm": return "application/vnd.ms-excel.template.macroEnabled.12"; case "xlam": return "application/vnd.ms-excel.addin.macroEnabled.12"; case "xlsb": return "application/vnd.ms-excel.sheet.binary.macroEnabled.12"; case "ppt": return "application/vnd.ms-powerpoint"; case "pot": return "application/vnd.ms-powerpoint"; case "pps": return "application/vnd.ms-powerpoint"; case "ppa": return "application/vnd.ms-powerpoint"; case "pptx": return "application/vnd.openxmlformats-officedocument.presentationml.presentation"; case "potx": return "application/vnd.openxmlformats-officedocument.presentationml.template"; case "ppsx": return "application/vnd.openxmlformats-officedocument.presentationml.slideshow"; case "ppam": return "application/vnd.ms-powerpoint.addin.macroEnabled.12"; case "pptm": return "application/vnd.ms-powerpoint.presentation.macroEnabled.12"; case "potm": return "application/vnd.ms-powerpoint.template.macroEnabled.12"; case "ppsm": return "application/vnd.ms-powerpoint.slideshow.macroEnabled.12"; case "mdb": return "application/vnd.ms-access";
Mime Application/vnd.ms-excel
The MIME type application/vnd.ms-excel is used to denote the presence of a Microsoft Excel spreadsheet or Microsoft Excel template. The category for this MIME type is «application».
Microsoft Excel or Microsoft Office Excel is a spreadsheet application developed by Microsoft. It is available from Microsoft for both the Windows series of OS» and Mac OS». It has graphing tools, calculation features, pivot tables and also a macro programming language called VBA (Visual Basic for Application). It is a widely used program that is also a part of the Microsoft Office suite of office software. Excel spreadsheet files take the extension XLS and Excel templates take the extension XLT. XLS is also the default file extension of MS Excel. They are both represented using this MIME type.
Excel has been widely adopted within the financial industry and it is considered to be one of the best software out there for making digital spreadsheets. Due to the VBS macro programming capabilities, the spreadsheets are also capable of being programmed individually to act as smaller programs themselves for generating output from given inputs. When used properly, it drastically reduces the effort required to be put into making complicated spreadsheets.
If you believe that some information on this page is incorrect — please let us know!
Copyright © 2023 mimeapplication.net
Неполный список типов MIME
Здесь представлен исчерпывающий список типов MIME, соотнесённых с типами документов и отсортированных по расширению.Два ключевых типа MIME, использующихся в качестве типов по умолчанию:
- text/plain является типом по умолчанию для текстовых файлов. Текстовый файл должен быть читаемым человеком и не должен содержать в себе бинарную информацию.
- application/octet-stream является типом по умолчанию для всех остальных случаев. Нужно использовать этот тип, если тип файла неизвестен. Браузеры уделяют дополнительное внимание при работе с данным типом файлов для предотвращения вредоносного поведения.
IANA является официальным регистром типов MIME и поддерживает их официальный список. В данной таблице представлен список типов, наиболее важных для Web:
| Расширение |
Тип документа |
Тип MIME |
| .aac |
AAC audio |
audio/aac |
| .abw |
AbiWord document |
application/x-abiword |
| .arc |
Archive document (multiple files embedded) |
application/x-freearc |
| .avi |
AVI: Audio Video Interleave |
video/x-msvideo |
| .azw |
Amazon Kindle eBook format |
application/vnd.amazon.ebook |
| .bin |
Any kind of binary data |
application/octet-stream |
| .bmp |
Windows OS/2 Bitmap Graphics |
image/bmp |
| .bz |
BZip archive |
application/x-bzip |
| .bz2 |
BZip2 archive |
application/x-bzip2 |
| .csh |
C-Shell script |
application/x-csh |
| .css |
Cascading Style Sheets (CSS) |
text/css |
| .csv |
Comma-separated values (CSV) |
text/csv |
| .doc |
Microsoft Word |
application/msword |
| .docx |
Microsoft Word (OpenXML) |
application/vnd.openxmlformats-officedocument.wordprocessingml.document |
| .eot |
MS Embedded OpenType fonts |
application/vnd.ms-fontobject |
| .epub |
Electronic publication (EPUB) |
application/epub+zip |
| .gz |
GZip Compressed Archive |
application/gzip |
| .gif |
Graphics Interchange Format (GIF) |
image/gif |
| .htm .html |
HyperText Markup Language (HTML) |
text/html |
| .ico |
Icon format |
image/vnd.microsoft.icon |
| .ics |
iCalendar format |
text/calendar |
| .jar |
Java Archive (JAR) |
application/java-archive |
| .jpeg .jpg |
JPEG images |
image/jpeg |
| .js |
JavaScript |
text/javascript |
| .json |
JSON format |
application/json |
| .jsonld |
JSON-LD format |
application/ld+json |
| .mid .midi |
Musical Instrument Digital Interface (MIDI) |
audio/midi audio/x-midi |
| .mjs |
JavaScript module |
text/javascript |
| .mp3 |
MP3 audio |
audio/mpeg |
| .mpeg |
MPEG Video |
video/mpeg |
| .mpkg |
Apple Installer Package |
application/vnd.apple.installer+xml |
| .odp |
OpenDocument presentation document |
application/vnd.oasis.opendocument.presentation |
| .ods |
OpenDocument spreadsheet document |
application/vnd.oasis.opendocument.spreadsheet |
| .odt |
OpenDocument text document |
application/vnd.oasis.opendocument.text |
| .oga |
OGG audio |
audio/ogg |
| .ogv |
OGG video |
video/ogg |
| .ogx |
OGG |
application/ogg |
| .opus |
Opus audio |
audio/opus |
| .otf |
OpenType font |
font/otf |
| .png |
Portable Network Graphics |
image/png |
| .pdf |
Adobe Portable Document Format (PDF) |
application/pdf |
| .php |
Hypertext Preprocessor (Personal Home Page) |
application/php |
| .ppt |
Microsoft PowerPoint |
application/vnd.ms-powerpoint |
| .pptx |
Microsoft PowerPoint (OpenXML) |
application/vnd.openxmlformats-officedocument.presentationml.presentation |
| .rar |
RAR archive |
application/vnd.rar |
| .rtf |
Rich Text Format (RTF) |
application/rtf |
| .sh |
Bourne shell script |
application/x-sh |
| .svg |
Scalable Vector Graphics (SVG) |
image/svg+xml |
| .swf |
Small web format (SWF) or Adobe Flash document |
application/x-shockwave-flash |
| .tar |
Tape Archive (TAR) |
application/x-tar |
| .tif .tiff |
Tagged Image File Format (TIFF) |
image/tiff |
| .ts |
MPEG transport stream |
video/mp2t |
| .ttf |
TrueType Font |
font/ttf |
| .txt |
Text, (generally ASCII or ISO 8859-n) |
text/plain |
| .vsd |
Microsoft Visio |
application/vnd.visio |
| .wav |
Waveform Audio Format |
audio/wav |
| .weba |
WEBM audio |
audio/webm |
| .webm |
WEBM video |
video/webm |
| .webp |
WEBP image |
image/webp |
| .woff |
Web Open Font Format (WOFF) |
font/woff |
| .woff2 |
Web Open Font Format (WOFF) |
font/woff2 |
| .xhtml |
XHTML |
application/xhtml+xml |
| .xls |
Microsoft Excel |
application/vnd.ms-excel |
| .xlsx |
Microsoft Excel (OpenXML) |
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
| .xml |
XML |
application/xml if not readable from casual users (RFC 3023, section 3) text/xml if readable from casual users (RFC 3023, section 3) |
| .xul |
XUL |
application/vnd.mozilla.xul+xml |
| .zip |
ZIP archive |
application/zip |
| .3gp |
3GPP audio/video container |
video/3gpp audio/3gpp if it doesn’t contain video |
| .3g2 |
3GPP2 audio/video container |
video/3gpp2 audio/3gpp2 if it doesn’t contain video |
| .7z |
7-zip archive |
application/x-7z-compressed |
Found a content problem with this page?
- Edit the page on GitHub.
- Report the content issue.
- View the source on GitHub.
This page was last modified on 3 авг. 2023 г. by MDN contributors.