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.
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.
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.
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.
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.
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".
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With