FileRequest

@Serializable
data class FileRequest(val base64: String, val name: String, val contentType: String = name.contentType().toString(), val progress: (percentage: Int) -> Unit = {})

Constructors

Link copied to clipboard
constructor(base64: String, name: String, contentType: String)
constructor(base64: String, name: String)
constructor(base64: String, name: String, progress: (percentage: Int) -> Unit)
constructor(base64: String, name: String, contentType: String = name.contentType().toString(), progress: (percentage: Int) -> Unit = {})

Properties

Link copied to clipboard

Base64 encoding of file

Link copied to clipboard

The file content type, eg "image/png", for full list of type you can check ContentType ByDefault

Link copied to clipboard

Name of the uploaded file with extension

Link copied to clipboard
val progress: (percentage: Int) -> Unit

Upload progress call back, make sure to invoke and calculate with ktor's onUpload

Functions

Link copied to clipboard
Link copied to clipboard
fun getType(): ContentType