Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MIME type for a directory

What's the MIME type for an OS directory?

When I attempt to detect a directory's MIME type using its content I get text/plain; charset=utf-8 on Ubuntu.

like image 600
Matt Joiner Avatar asked Sep 18 '13 10:09

Matt Joiner


People also ask

What is MIME type of folder?

In GNOME, MIME (Multipurpose Internet Mail Extension) types are used to identify the format of a file. The GNOME Desktop uses MIME types to: Determine which application should open a specific file format by default.

What are MIME types for files?

A MIME type consists of two parts: a type and a subtype. Currently, there are ten registered types: application, audio, example, font, image, message, model, multipart, text, and video.

How do I specify a MIME type?

A MIME type has two parts: a type and a subtype. They are separated by a slash (/). For example, the MIME type for Microsoft Word files is application and the subtype is msword. Together, the complete MIME type is application/msword.

What is MIME type example?

MIME types enable browsers to recognize the filetype of a file which has been sent via HTTP by the webserver. As a result the browser is able to choose a suitable displaying method. Common MIME types are for example text/html for html-files or image/jpeg for jpeg-files.


2 Answers

On Ubuntu, a directory mimetype is inode/directory

If you run, on Ubuntu:

$ mimetype /home/<your username> /home/<your username>: inode/directory 

There is a "text/directory" in the IANA standards (http://www.rfc-editor.org/rfc/rfc2425.txt and http://www.iana.org/assignments/media-types/text) but it was marked "deprecated".

like image 91
naazgull Avatar answered Oct 26 '22 07:10

naazgull


There is no universal answer to this question.

Directories are not considered to have MIME types on Windows.

On Android, the directories exposed by a document provider are of type "vnd.android.document/directory" while those exposed by other content providers are typically of the form "vnd.android.cursor.dir/<something>".

On Linux, the xdg shared mime info spec dictates "inode/directory" be used for associating directories with applications.

like image 38
j__m Avatar answered Oct 26 '22 06:10

j__m