Questions tagged [mime-types]

An Internet media type or MIME type (named for Multipurpose Internet Mail Extensions) is a two-part identifier for file formats on the Internet.

3430 questions
11461
votes
39 answers

Which JSON content type do I use?

There are many "standards" for the JSON content type: application/json application/x-javascript text/javascript text/x-javascript text/x-json Which one do I use, and where? I assume security and browser support issues are a factor. Related: What…
Oli
  • 235,628
  • 64
  • 220
  • 299
1274
votes
10 answers

What is a correct MIME type for .docx, .pptx, etc.?

For older *.doc documents, this was enough: header("Content-Type: application/msword"); What MIME type should I use for new .docx documents? Also, for pptx and xlsx documents?
Richard Knop
  • 81,041
  • 149
  • 392
  • 552
764
votes
70 answers

Stylesheet not loaded because of MIME type

I'm working on a website that uses Gulp.js to compile and browser sync to keep the browser synchronised with my changes. The Gulp.js task compiles everything properly, but on the website, I'm unable to see any style, and the console shows this error…
Nick
  • 13,493
  • 8
  • 51
  • 98
599
votes
5 answers

What MIME type should I use for CSV?

I've seen application/csv used and also text/csv. Is there a difference? Does it matter which as long as the request matches something that's available? Are they interchangeable?
Steve Dunn
  • 21,044
  • 11
  • 62
  • 87
559
votes
3 answers

What is correct content-type for excel files?

I want excel files on a website to open in Excel when clicked, not get saved on desktop, or get opened embedded in a browser etc. Now obviously it all depends on how everything is configured for each user, but what's the best Content-Type and other…
taw
  • 18,110
  • 15
  • 57
  • 76
535
votes
4 answers

Is the MIME type 'image/jpg' the same as 'image/jpeg'?

Pretty simple question but can't seem to find it anywhere online. I'm trying to make a program that depending on the file type will give me the extension.
Joe Scotto
  • 10,936
  • 14
  • 66
  • 136
378
votes
7 answers

What does "Content-type: application/json; charset=utf-8" really mean?

When I make a POST request with a JSON body to my REST service I include Content-type: application/json; charset=utf-8 in the message header. Without this header, I get an error from the service. I can also successfully use Content-type:…
DenaliHardtail
  • 27,362
  • 56
  • 154
  • 233
370
votes
8 answers

File input 'accept' attribute - is it useful?

Implementing a file upload under html is fairly simple, but I just noticed that there is an 'accept' attribute that can be added to the tag. Is this attribute useful as a way of limiting file uploads to images, etc? What is…
Darren Oster
  • 9,146
  • 10
  • 48
  • 66
352
votes
6 answers

What is a MIME type?

I have been reading about how to build plug-ins and this "MIME type" keeps getting discussed in it. I have tried to look into it and know that it is Multipurpose Internet Mail Extensions (MIME) but no suitable explanation of how it relates to…
Mohsin Sheikh Khalid
  • 3,914
  • 5
  • 20
  • 22
318
votes
20 answers

Chrome says "Resource interpreted as script but transferred with MIME type text/plain.", what gives?

In FF and all, my javascript works fine. But in Chrome it gives this message: Resource interpreted as script but transferred with MIME type text/plain. I have checked all the script tags and they all have the MIME type="text/javascript". It even…
Shaoz
  • 10,573
  • 26
  • 72
  • 100
305
votes
4 answers

Proper MIME type for .woff2 fonts

Today I updated Font Awesome package to 4.3.0 and noticed that woff2 font was added. That file is linked in CSS so I need to configure nginx to serve woff2 files properly. Currently I have this block in nginx config for fonts: location ~*…
Limon Monte
  • 52,539
  • 45
  • 182
  • 213
299
votes
4 answers

Which MIME type to use for a binary file that's specific to my program?

My program uses its own binary file type, so I assume I can't use MIME type text/plain, as it is not a 7-bit ASCII file. Should I just call it "application/myappname"?
Powerbook165c
  • 2,999
  • 2
  • 15
  • 3
277
votes
12 answers

How to check file MIME type with JavaScript before upload?

I have read this and this questions which seems to suggest that the file MIME type could be checked using JavaScript on client side. Now, I understand that the real validation still has to be done on server side. I want to perform a client side…
Question Overflow
  • 10,925
  • 18
  • 72
  • 110
268
votes
20 answers

Using .NET, how can you find the mime type of a file based on the file signature not the extension

I am looking for a simple way to get a mime type where the file extension is incorrect or not given, something similar to this question only in .Net.
Richard Gourlay
  • 5,518
  • 6
  • 23
  • 17
240
votes
1 answer

Right mime type for SVG images with fonts embedded

This is the usual SVG mime type: image/svg+xml And it works great. However, when embedding an SVG font, chrome tells you the mime type is incorrect, obviously because you return a font instead of an image. Is there any universal mime type? is…
cmplieger
  • 7,155
  • 15
  • 55
  • 83
1
2 3
99 100