sendImage

fun sendImage(channelType: String, channelId: String, file: File, callback: ProgressCallback? = null): Call<UploadedFile>

Uploads an image for the given channel. Progress can be accessed via callback.

The Stream CDN imposes the following restrictions on image uploads:

Return

Executable async Call which completes with Result containing an instance of UploadedFile if the image was successfully uploaded.

Parameters

channelType

The channel type. ie messaging.

channelId

Еhe channel id. ie 123.

file

The image file that needs to be uploaded.

callback

The callback to track progress.

See also


fun sendImage(channelType: String, channelId: String, file: File, messageId: String?, callback: ProgressCallback?): Call<UploadedFile>

Uploads an image that belongs to the message with messageId, so the id can be propagated to the FileUploader as part of the upload context.

Return

Executable async Call which completes with Result containing an instance of UploadedFile if the image was successfully uploaded.

Parameters

channelType

The channel type. ie messaging.

channelId

The channel id. ie 123.

file

The image file that needs to be uploaded.

messageId

The id of the message the image belongs to, or null when the upload is not part of sending a message.

callback

The callback to track progress.