Questions tagged [mime-types]

A MIME type after MIME (Multipurpose Internet Mail Extensions) is a two-part identifier for file formats on the Internet.

3161 questions
1121
votes
9 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
  • 73,317
  • 142
  • 374
  • 539
546
votes
57 answers

Stylesheet not loaded because of MIME-type

I'm working on a website that uses gulp to compile and browser sync to keep the browser synchronised with my changes. The gulp task compiles everything properly, but on the website, I'm unable to see any style, and the console shows this error…
Nick
  • 10,791
  • 6
  • 40
  • 82
504
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
  • 18,426
  • 11
  • 59
  • 85
501
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
  • 16,697
  • 14
  • 52
  • 73
410
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
  • 8,050
  • 7
  • 41
  • 100
348
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
  • 8,714
  • 10
  • 43
  • 63
319
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,223
  • 25
  • 64
  • 98
316
votes
6 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
  • 24,560
  • 51
  • 134
  • 216
295
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,298
  • 5
  • 15
  • 21
292
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
  • 44,025
  • 43
  • 163
  • 189
254
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,541
  • 2
  • 11
  • 3
253
votes
21 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,198
  • 6
  • 19
  • 17
212
votes
9 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
  • 9,707
  • 18
  • 68
  • 108
197
votes
27 answers

How to determine MIME type of file in android?

Suppose I have a full path of file like:(/sdcard/tlogo.png). I want to know its mime type. I created a function for it public static String getMimeType(File file, Context context) { Uri uri = Uri.fromFile(file); ContentResolver cR =…
Sushant Bhatnagar
  • 3,234
  • 9
  • 29
  • 39
188
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
  • 6,375
  • 15
  • 49
  • 80
1
2 3
99 100