addAttachmentOrNull

fun addAttachmentOrNull(name: String, contentType: String, data: ByteArray): FormAttachment?

Deprecated

Since 300.0.0. This method will not validate the duration of audio and video attachments. Use the suspend function addAttachment(contentType: String, data: ByteArray, name: String? = null) instead.

Replace with

addAttachment(contentType, data, name)

Adds a new attachment to this AttachmentsFormElement.

Return

The new FormAttachment, or null if an error occurred.

Since

200.5.0

Parameters

name

the name of the attachment

contentType

the mime type of the attachment

data

the attachment data