This document is archived and information here might be outdated.  Recommended version.


IAttachment.ContentType Property (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Geodatabase > ESRI.ArcGIS.GeoDatabase > Interfaces > IA > IAttachment Interface > IAttachment.ContentType Property
ArcGIS Developer Help

IAttachment.ContentType Property

Content type that describes the attachment data.

[Visual Basic .NET]
Public Property ContentType As String
[C#]
public string ContentType {get; set;}
[C++]
HRESULT get_ContentType(
  BSTR ContentType
);
[C++]
HRESULT put_ContentType(
  System.String* ContentType
);
[C++]
Parameters
ContentType [in]

ContentType is a parameter of type BSTR ContentType [out, retval]
ContentType is a parameter of type BSTR*

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Remarks

The ContentType property must be populated with the full MIME type name as would be used in an HTTP request for the items being attached. The MIME type string should consist of both the type and the subtype and follow the pattern (without the square brackets) of [MIME type name]/[MIME subtype name]. An attached jpeg image would have a MIME type of image, and a MIME subtype of jpeg, yielding a ContentType string of image/jpeg.

Below are a few common examples:

Full MIME Type Name Common File Extension  Purpose
text/html .html Web Page
image/png .png PNG-format image
image/jpeg .jpeg JPEG-format image
audio/mpeg .mp3 MPEG Audio File

The official list can be found at http://www.iana.org/assignments/media-types/index.html

See Also

IAttachment Interface