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
public string ContentType {get; set;}
HRESULT get_ContentType(
  BSTR ContentType
HRESULT put_ContentType(
  System.String* ContentType
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.


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

See Also

IAttachment Interface