Several objects have an associated MIME (Multipurpose Internet Mail Extension) type. Simply, MIME is a standard protocol to identify the data type of a file. For a Content Platform Engine object, the MIME type recognizes the type of content which is associated with the object. The MIME type offers you to manually or programmatically signify the appropriate application for showing or editing the content. Also, you are able to use the MIME type of a newly added document as a means for choosing a class for the document automatically.
The following objects have an associated MIME (Multipurpose Internet Mail Extension) type:
- Content elements (Content Type property)
The Content Type property shows the MIME type for a content transfer element or a content reference element. A content turn element represents Content Platform Engine managed content. While a content reference element represents managed content externally.
- Documents and annotations (Mime Type property)
The Mime Type property shows the MIME type for a document or annotation as a whole. This MIME type is able to be different from the MIME type of any of the content elements which belong to the document.
After you check in a document, you will not be able to change the value of any MIME type property that is associated with the document. Particularly, the Content Type and MIME Type become read only on the objects such as any annotations which are associated with the document, checked in a document, and any content elements which belong to the document or associated annotations. Contrarily, before or during you check in a document, you are able to assign a MIME type to those objects. An explicit MIME type assignment prevents the default MIME type assignment performed by Content Platform Engine.
DEFAULT MIME TYPE ASSIGNMENT
Once you check in a document, the Content Platform Engine potentially assigns a default MIME type to the objects below:
Content transfer elements (Content Type property)
A content transfer element is determined as a default MIME type if the element has no MIME type or the value of the Content Type property is empty). The MIME type determined is one of the following options:
- MIME type associated with the Retrieval Name property
If the Retrieval Name property identifies a file name with an extension, Content Platform Engine searches the mimetypes.properties file for the MIME type mapped to that extension. This mapped MIME type is the default MIME type assigned. For instance, the Retrieval Name for a content transfer element may be abc.txt. (Optionally, you are able to set the Retrieval Name to be the name of the original content file.) The Content Platform Engine discovers the MIME type mapped to the .txt extension. It identifies that mapped type as the default MIME type. For information regarding editing the mimetypes.properties file, you are able to find another article on how to associate a MIME type with a file extension.
- Application/octet-stream
If the determination of the associated MIME type for the Retrieval Name property fails, then the Content Platform Engine sets application or octet-stream as default MIME type. This failure happens when the property does not identify a file name extension or when no mapped MIME type is able to be found for the extension.
Documents and annotations (Mime Type property)
A document or annotation object is determined as a default MIME type if the object has these attributes: no MIME type and one or more content elements. The MIME type is the MIME type of the first content element for objects specified by the Content Type property for elements. The MIME type for the first content element may be one that Content Platform Engine has assigned: Content Platform Engine assigns any required default MIME types to content transfer elements before doing so for documents or annotations. No default MIME type is determined to content reference elements. Remember that document check-in fails with an error if the document has one or more content reference elements with no MIME type.
Based on the research, the Content Platform Engine potentially sets a default MIME type to a document, annotation, or content transfer element. Before you check-in a document, an application is also able to potentially set a MIME type. From an application point of view, those application-supplied MIME types are default MIME types. In this case, you have to identify the MIME type directly to avoid the possibility of Content Platform Engine or an application assigning an incorrect MIME type by default.
When you utilize the Create New Document wizard, MIME types are assigned to the objects below:
Content elements (Content Type property)
A content element is determined as a default MIME type when you add the element to a document. The MIME type assigned is one of the options such as below:
- MIME type associated with the user-specified file name
If you specify a file name with an extension, then the Content Platform Engine is going to search the Windows registry for the MIME type mapped to the extension. The mapped MIME type is the default MIME type assigned. For instance, you may submit abc.txt as the file name.
- User-specified file name extension
The file name extension is determined as the default MIME type if no mapped MIME type is able to be found for the extension.
Documents (Mime Type property)
A document is determined as a default MIME type when you add a content element to the document and the document has no MIME type. The MIME type assigned is the MIME type of the added element (as determined by the Content Type property for the element). The MIME type of the added element may be one that Content Platform Engine has assigned.
Well, the text above is an explanation about MIME type. Now, you may understand what MIME type is. Even now, you are able to know the default MIME type. If you need more information, you are able to read other articles on our sites.
AUTHOR BIO
On my daily job, I am a software engineer, programmer & computer technician. My passion is assembling PC hardware, studying Operating System and all things related to computers technology. I also love to make short films for YouTube as a producer. More at about me…