What is the MIME type for properties file?
Here is a list of all the files with different extensions but here I could not see any MIME type for the properties file.
Mime Types
I have a properties file in my scripts folder and I am trying to read it in another scripts. When run as simple HTML file and a script file it works properly but when I put it in my web application which uses Spring MVC, its not able to read the properties file.
The error I get is
No media type found for ServletContext resource [Messages_en.properties] -returning 404.
Please help.
MIME properties are defined or arbitrary values that you can use to attach MIME document headers to documents within your integration process. For example, MIME properties can be set so that shapes like the HTTP Client connector can identify a MIME document as it passes through a process.
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.
For detecting MIME-types, use the aptly named "mimetype" command. It has a number of options for formatting the output, it even has an option for backward compatibility to "file". But most of all, it accepts input not only as file, but also via stdin/pipe, so you can avoid temporary files when processing streams.
There are too many issues with MIME types on different operating systems, different applications saving files differently, some files not having a MIME at all, and lastly, the fact that the extension and MIME could be altered by a malicious user or program.
Commonly used is text/x-java-properties
. E.g. project MoinMoin uses that.
According to Apache HTTPd's Mime type list which is probably the most extensive you can find, there is no definition for properties files.
It's not clear to me what you're trying to achieve, but generally text/plain
works well with properties files.
According to IANA Media Types which is the most authoritative source, there is no standard MIME type for Java Properties files.
Apache HTTPD / Subversion MIME type lists (which are referenced in other answers as the one from @nico) are simply a copy of IANA's.
RFC2046 specifies that Media Types (formerly known as MIME types) and Media Subtypes will be assigned and listed by the IANA. (Source IANA Media Types)
Anyway, I've to agree with @Ondra Žižka that a few non-authoritative - but relevant - sources (like Trac and CaCert.org, for instance) are seemingly converging onto the text/x-java-properties
type, which is correctly using the `x-' prefix.
There is not a dozen places where this MIME type is used, though.
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