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
119
votes
8 answers

How to check if an intent can be handled from some activity?

I have this method so far , but it came up like something is missing for example I have a file /sdcard/sound.3ga that returns false ( like there is no activity that can handle this type of file ) , But when I open it from the file manager it opens…
Lukap
  • 29,596
  • 60
  • 146
  • 239
118
votes
5 answers

What is the javascript MIME type for the type attribute of a script tag?

What is the MIME type of javascript? More specifically, what is the right thing to put in the "type" attribute of a script tag? application/x-javascript and text/javascript seem to be the main contenders.
defrex
  • 13,028
  • 7
  • 32
  • 44
116
votes
5 answers

What is the MIME type for Markdown?

Does anyone know if there exists a MIME type for Markdown? I guess it is text/plain, but is there a more specific one?
ilanco
  • 8,757
  • 4
  • 29
  • 37
113
votes
6 answers

Which mime type should I use for mp3

I'm trying to decide which mime type to choose for returning mp3 data (served up by php) according to this listing of mime types: http://www.webmaster-toolkit.com/mime-types.shtml .mp3 audio/mpeg3 .mp3 audio/x-mpeg-3 .mp3 video/mpeg .mp3 …
Kristian
  • 19,340
  • 14
  • 84
  • 156
110
votes
1 answer

Maximum MIMEType Length when storing type in DB

What are people using as the length of a MIMEType field in their databases? The longest one we've seen so far is 72 bytes: application/vnd.openxmlformats-officedocument.wordprocessingml.document but I'm just waiting for a longer one. We're using…
Walden Leverich
  • 4,190
  • 2
  • 19
  • 29
107
votes
4 answers

What's the difference of ContentType and MimeType

As far as I know, they are absolute equal. However, browsing some django docs, I've found this piece of code: HttpResponse.__init__(content='', mimetype=None, status=200, content_type='text/html') which surprise me the two getting along each other.…
Frangossauro
  • 3,636
  • 4
  • 20
  • 14
97
votes
3 answers

Resource interpreted as Script but transferred with MIME type text/plain - for local file

I'm getting a "Resource interpreted as Script but transferred with MIME type text/plain" warning in Google Chrome when including a local script file. I know the problem appears when loading a file from a server or through ajax which most often…
batzkoo
  • 1,285
  • 1
  • 10
  • 10
91
votes
6 answers

How I can get the mime type of a file having its Uri?

I have a List of Uris obtained with the Gallery and the Camera. These Uris are like this: content://media/external/images/media/94. How I can get its mime type?
Brais Gabin
  • 5,447
  • 5
  • 50
  • 88
89
votes
1 answer

Preferred (or most common) file extension for a Python pickle

At times, I've seen .pickle, .pck, .pcl, and .db for files that contain Python pickles, but I am unsure what is the most common or best practice. I know that the latter three extensions are also used for other things. The related question is: What…
Raymond Hettinger
  • 182,864
  • 54
  • 321
  • 419
88
votes
6 answers

How is mime type of an uploaded file determined by browser?

I have a web app where the user needs to upload a .zip file. On the server-side, I am checking the mime type of the uploaded file, to make sure it is application/x-zip-compressed or application/zip. This worked fine for me on Firefox and IE. …
Kip
  • 99,109
  • 82
  • 222
  • 258
85
votes
3 answers

What's the difference between mediatype, contenttype and mimetype?

Is there a difference between mimetype, contenttype and mediatype? (Java's JAX-RS MediaType). From the wikipedia article i gathered that it's only a content-type in the context of e.g. HTTP requests as a field in a request's header: So are these…
fasseg
  • 16,636
  • 8
  • 58
  • 72
85
votes
1 answer

text/javascript vs application/javascript

I am curious about the semantics of the MIME types application/javascript versus text/javascript. Obviously, one is supposed to be executed, and the other is supposed to be just text. I see application/javascript when looking at headers of an…
ddavison
  • 25,442
  • 12
  • 70
  • 96
81
votes
6 answers

Multiple MIME types in Android

Is there a way to use intent.setType() and supply multiple broad types (like images and video)? I am using an ACTION_GET_CONTENT. It seems to be working with just comma-separated types.
James
  • 811
  • 1
  • 6
  • 4
76
votes
13 answers

Determine file type in Ruby

How does one reliably determine a file's type? File extension analysis is not acceptable. There must be a rubyesque tool similar to the UNIX file(1) command? This is regarding MIME or content type, not file system classifications, such as directory,…
Clint Pachl
75
votes
2 answers

Mime type for .txt files?

I´m trying to share a .txt file with share intent. If I set "text/plain" as mime type, it reads the content like text not like text file, then the options given in the share menu are Whatsapp, Line, etc.. Does anybody know how to configure the share…
user23
  • 2,696
  • 2
  • 22
  • 24