FRAMES | NO FRAMES | Description | Parameters | Examples | Response |
URL | http://<featureservicefeature-url>/updateAttachment (POST only) |
Parent Resource | Feature |
---|
This operation updates an attachment associated with a feature (POST only). The update attachment operation is performed on a feature service feature resource.
Since this request uploads a file, it must be a multi-part request as per IETF RFC1867.
This operation is available only if the layer has advertised that it has attachments.
A layer has attachments if its hasAttachments
property is true
.
objectId
of the result is the ID of the updated attachment.
You can provide arguments to the update attachment operation as query parameters defined in the parameters table below.
Parameter | Details |
---|---|
f | Description: The
response format. The default response format is html. Values: html | json |
attachmentId |
Description:
The ID of the attachment to be updated.
Example: attachmentId=58
|
attachment |
Description:
The file to be uploaded as the updated feature attachment.
The content type, size and name of the attachment will be derived from the uploaded file. |
Example 1: Update an attachment using the update attachment operation on a feature service feature resource. In this sample url the update attachment operation is performed on feature id 818654 belonging to layer 0 of the 311Incidents FeatureService
http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/FeatureServer/0/818654/updateAttachment
The input parameters attachmentIds and attachment to this operation are the Id of the attachment to be updated and a file.
{
"updateAttachmentResult": {
"objectId" : <attachmentId>,
"globalId" : <globalId>,
"success" : <true | false>,
"error" : { //only if success is false
"code" : <code1>,
"description" : "<description>",
}
}
}
{ "updateAttachmentResult": { "objectId" : 58, "globalId" : null, "success" : true } }