addAttachment

addAttachment

Function
addAttachment(requestOptionsIAddAttachmentOptions): Promise<{ addAttachmentResult: IEditFeatureResult }>

Attach a file to a feature by id. See Add Attachment for more information.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
import { addAttachment } from '@esri/arcgis-rest-feature-service';
//
addAttachment({
  url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/ServiceRequest/FeatureServer/0",
  featureId: 8484,
  attachment: myFileInput.files[0]
})
  .then(response)
Parameters
ParameterTypeNotes
requestOptions
IAddAttachmentOptions

Options for the request.

Returns 
Promise<{ addAttachmentResult: IEditFeatureResult }>

A Promise that will resolve with the addAttachment() response.

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