File

@Serializable
data class File @JvmOverloads constructor(val name: String = DEFAULT_FILE_NAME, val data: ByteArray = byteArrayOf(), val type: String? = null)(source)

Representation of a file to be used in a form.

Constructors

Link copied to clipboard
constructor(data: ByteArray, type: String? = null)
constructor(name: String = DEFAULT_FILE_NAME, data: ByteArray = byteArrayOf(), type: String? = null)

Types

Link copied to clipboard
object Base64Serializer : KSerializer<File>

Serializer used to serialize the file's data as base 64. Useful when using formats such as JSON which do not support binary data.

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

File content.

Link copied to clipboard

Name of the file.

Link copied to clipboard
val size: Int

Size of the file's data, in bytes.

Link copied to clipboard
val type: String? = null

File MIME type.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String