addAttachment

suspend fun addAttachment(name: String, contentType: String, data: ByteArray?, keywords: String = ""): Result<Attachment>

Adds a new attachment, with keywords, to this feature.

Return

A Result containing the new Attachment. An ArcGISException will be set on the Result if the feature layer doesn't support the attachment keywords

Since

300.0.0

Parameters

name

The attachment name.

contentType

The type of content.

data

The attachment data.

keywords

Attachment keywords. The attachment keywords can be accessed using Attachment.keywords.

See also


suspend fun addAttachment(name: String, contentType: String, filePath: String, keywords: String = ""): Result<Attachment>

Adds a new attachment, with keywords, to this feature from the specified file.

Return

A Result containing the new Attachment. A FileNotFoundException will be set on the Result if the file at filePath does not exist, and an ArcGISException will be set on the Result if the feature layer doesn't support attachments or if the feature table does not support keywords

Since

300.0.0

Parameters

name

The name of the Attachment.

contentType

The type of content.

filePath

Path to a file that will be used for the attachment's content.

keywords

Attachment keywords. The attachment keywords can be accessed using Attachment.keywords.

See also