Attachment (Map Service/Layer)

URL:
https://<attachmentinfos-url>/<attachmentId>
Methods:
GET
Required Capability:
Query
Version Introduced:
10.0

Description

The attachment resource represents an individual attachment associated with a feature. This resource is available only if the layer has advertised that it has attachments. A layer has attachments if its hasAttachments property is true .

The content of the attachment is streamed to the client. If the attachment is not found, an HTTP status code of 404 (Not found) is returned.

Request parameters

ParameterDetails

gdbVersion

The geodatabase version to query. This parameter applies only if the hasVersionedData property of the service and the isDataVersioned property of the layer or layers queried are true .

If this is not specified, the query will apply to the published map's version.

Syntax: gdbVersion=<geodatabase version>

Example: gdbVersion=sde.USER1

w

An integer value that describes the width to resize an attachment image to when returned with the attachment resource. The resizing maintains the aspect ratio and is only applied to attachment images. Images cannot be made larger that the stored image by setting a larger w value. Sizes may also be snapped to the nearest preset size. By default, a value for w is not set, and the full resolution of the image is returned. This parameter is only supported when the supportsAttachmentsResizing layer property is set to true .

Example

Use dark colors for code blocksCopy
1
w=100

Example usage

Example 1

Example 1: Retrieve attachment (with ID=1) of a feature whose objectID is 818654.

https://organization.example.com/<context>/rest/services/SanFrancisco/311Incidents/MapServer/0/818654/attachments/1

Example 2

Example 2: Retrieve attachment from an alternate SDE version.

https://organization.example.com/<context>/rest/services/SanFrancisco/311Incidents/MapServer/0/818654/attachments/1?gdbVersion=sde.DynamicLayers

Example 3

Example 3: Retrieve an attachment image in a specified size.

https://organization.example.com/<context>/rest/services/SanFrancisco/311Incidents/MapServer/0/818654/attachments/1?w=150

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.