sendFile

open fun sendFile(uploadContext: FileUploadContext, file: File, callback: ProgressCallback? = null): Result<UploadedFile>

Uploads a file within the given uploadContext. Progress can be accessed via callback.

When the upload is part of sending a message, FileUploadContext.messageId carries the id the message will be sent with.

The default implementation ignores the extra context and delegates to the corresponding legacy overload: sendFile(channelType, channelId, userId, file, callback) when callback is not null, sendFile(channelType, channelId, userId, file) otherwise.

Return

The Result object containing an instance of UploadedFile in the case of a successful upload or an exception if the upload had failed.


abstract fun sendFile(channelType: String, channelId: String, userId: String, file: File, callback: ProgressCallback): Result<UploadedFile>

Uploads a file for the given channel. Progress can be accessed via callback.

Return

The Result object containing an instance of UploadedFile in the case of a successful upload or an exception if the upload had failed.

See also


abstract fun sendFile(channelType: String, channelId: String, userId: String, file: File): Result<UploadedFile>

Uploads a file for the given channel.

Return

The Result object containing an instance of UploadedFile in the case of a successful upload or an exception if the upload had failed.

See also