UploadedFile

@Serializable
data class UploadedFile(val file: PlatformFile, val enabled: Boolean = true, val progress: () -> Float? = null, val isLoading: Boolean = false, val errorMessage: String? = null)(source)

Represents a file that has been selected or uploaded within the Spark file upload components.

This class wraps the underlying PlatformFile and provides additional state such as upload progress, error messages, and UI interaction states to represent the uploaded state of this specific selected file.

Constructors

Link copied to clipboard
constructor(file: PlatformFile, enabled: Boolean = true, progress: () -> Float? = null, isLoading: Boolean = false, errorMessage: String? = null)

Properties

Link copied to clipboard

Whether interaction with this file in the UI (e.g., removal) is enabled.

Link copied to clipboard

An optional error message to display if the upload failed.

Link copied to clipboard
val file: PlatformFile

The underlying platform-specific file reference. System file information are contained here.

Link copied to clipboard

Whether the upload is in indeterminate loading state.

Link copied to clipboard
val mimeType: MimeType?

The detected MimeType of the file, if available.

Link copied to clipboard

The display name of the file (e.g., "document.pdf").

Link copied to clipboard
val progress: () -> Float?

A lambda returning the upload progress as a float between 0.0 and 1.0. If null, no progress indicator is shown.

Link copied to clipboard

The size of the file in bytes.