Map service QueryAttachmentData method

Queries and returns the multimedia data as mime or URL.

QueryAttachmentData(string MapName, int SourceTableID, int[] AttachmentIDs)




The name of the map (data frame) that contains the layer associated with the SourceTableID parameter.


The layer or standalone table id of the source layer or table.


An array of integers. Each integer represents a unique identifier for attached data that would be retrieved.

Return Value

An array of AttachmentData objects (AttachmentData[ ]), each containing an AttachmentInfo object to relate the data back to the feature or row that this data is attached to and get meta information about the data and the data itself.


For layers, the LayerID property of the MapLayerInfo is used as the SourceTableID. For stand alone tables, the ID property of the StandaloneTableInfo is used as the SourceTableID.

ArcGIS Server recognizes when a layer or table supports attachments and advertises it. An attachment could be any multi-media file format, such as a document in PDF format, a photo or even a video. The layer's MapLayerInfo or table's StandaloneTableInfo has the HasAttachments property used to ascertain if attachments exist for the layer or table.

It is a two step process to retrieve any attached data once you know which layer has attachments:

  1. Use QueryAttachmentInfos to get AttachmentIDs for all attached multimedia data attached to a feature or row.
  2. Use this method to retrieve the data from the server.

The data comes to the client as a URL or as MIME.