Skip to content
import AttachmentInfo from "@arcgis/core/rest/query/support/AttachmentInfo.js";
Inheritance:
AttachmentInfoAccessor
Since
ArcGIS Maps SDK for JavaScript 4.19

The AttachmentInfo class returns information about attachments associated with a feature. The contents of the attachment are streamed to the client. Attachments are available if the FeatureLayer.capabilities.data.supportsAttachment is true.

popuptemplate-attachments-element-list

See also

Constructors

Constructor

Constructor
Parameters
ParameterTypeDescriptionRequired
properties
See the properties table for a list of all the properties that may be passed into the constructor.

Properties

Any properties can be set, retrieved or listened to. See the Watch for changes topic.

contentType

Property
Type
string

The content type of the attachment. For example, 'image/jpeg'. See the ArcGIS REST API documentation for more information on supported attachment types.

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor

The name of the class. The declared class name is formatted as esri.folder.className.

exifInfo

Property
Type
ExifInfo[] | null | undefined

An array of ExifInfo for the attachment.

globalId

Property
Type
string

The global identifier for the attachment.

id

Property
Type
number

The identifier for the attachment.

keywords

Property
Type
string

Keywords used for the attachments.

name

Property
Type
string

String value indicating the name of the file attachment.

orientationInfo

readonly Property
Type
OrientationInfo

The OrientationInfo for the attachment. This is derived from the exifInfo. In order to read this, you must first set the attachment query's AttachmentQuery.returnMetadata to true to get the exif info associated with the attachment.

parentGlobalId

Property
Type
string | null | undefined

The parent or the feature global id of the attachment.

parentObjectId

Property
Type
ObjectId | null | undefined

The parent or the feature object id of the attachment.

size

Property
Type
number

The file size of the attachment. This is specified in bytes.

url

Property
Type
string | null | undefined

The URL of the attachment.

Methods

MethodSignatureClass
fromJSON
inherited static
fromJSON(json: any): any
clone(): AttachmentInfo
toJSON
inherited
toJSON(): any

fromJSON

inheritedstatic Method
Signature
fromJSON (json: any): any
Inherited from: JSONSupportMixin

Creates a new instance of this class and initializes it with values from a JSON object generated from an ArcGIS product. The object passed into the input json parameter often comes from a response to a query operation in the REST API or a toJSON() method from another ArcGIS product. See the Using fromJSON() topic in the Guide for details and examples of when and how to use this function.

Parameters
ParameterTypeDescriptionRequired
json
any

A JSON representation of the instance in the ArcGIS format. See the ArcGIS REST API documentation for examples of the structure of various input JSON objects.

Returns
any

Returns a new instance of this class.

clone

Method
Signature
clone (): AttachmentInfo

Creates a deep clone of the AttachmentInfo class.

Returns
AttachmentInfo

A deep clone of the AttachmentInfo instance.

toJSON

inherited Method
Signature
toJSON (): any
Inherited from: JSONSupportMixin

Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() guide topic for more information.

Returns
any

The ArcGIS portal JSON representation of an instance of this class.

Type definitions

OrientationInfo

Type definition

An object containing properties specific to the orientation of an image attachment. This information is stored within the attachment's exifInfo. In order to read this, you must first set the attachment query's AttachmentQuery.returnMetadata to true to get the exif info associated with the attachment.

id

Property
Type
number

The identifier for the orientation info.

rotation

Property
Type
number

The rotation value for the attached image.

mirrored

Property
Type
boolean

Indicates whether the image displays mirrored.