145

Is there what could be considered a "default" mimetype?

I've seen "unknown/unknown" and "application/binary". But is there a default to revert to when no other MIME type is found?

1

1 Answer 1

232

The least specific official MIME type is application/octet-stream. Without any additional information, it says "here is a bunch of bytes, hopefully there is an application over on your end which knows what to do with them". Sometimes there is a file name which helps convey to the recipient what to do with the data.

"unknown" doesn't really add anything over this, except to confuse clients who don't support random unofficial MIME types. Ditto for application/binary; it's just a non-standard way of restating "octet-stream".

This is the answer to "What can I put in the Content-Type: header if I can't find an existing content type which adequately describes my data?" which is how I have interpreted this question. The proposed duplicate Unknown file type MIME? has a lengthy answer which discusses "How is my data interpreted if I don't put a valid Content-Type: header?" specifically in an HTTP context; the answer to that is protocol-specific (in email, for example, the default implied Content-Type: for MIME body parts which do not contain this header is text/plain; charset="us-ascii").

5
  • You're wrong. IETF says default is no content type. read more carrefully your link
    – FF_Dev
    Commented Mar 1, 2016 at 11:42
  • @FF_Dev Not sure what you mean. Are you saying Sampo's link to his own answer is wrong? Or that my answer is wrong? Or something else?
    – tripleee
    Commented Mar 1, 2016 at 11:51
  • @tripleee His answer says "Do not send MIME type for unknown data." which is different than this answer. So either his comment is irronical, either it is wrong. It deserved to be highlighted
    – FF_Dev
    Commented Mar 1, 2016 at 12:00
  • tripleee & @FF_Dev I think that my answer was not phrased clearly enough and TLDR part was a bit confusing as I did not made it completely clear what you should leave out when dealing with unknown stuff. Commented May 26, 2016 at 14:05
  • 5
    @SampoSarrala The answer talks about HTTP specifically, though; MIME has many applications, many of which may be governed by other specifications, or none at all. A specific counter-example is email, where omitting the content type implies text/plain, for backwards compatibility.
    – tripleee
    Commented May 26, 2016 at 14:36

Not the answer you're looking for? Browse other questions tagged or ask your own question.