uploadBase64File

fun uploadBase64File(base64Data: String, token: String, fileName: String, listener: TaskCompletionListener<String, String>)

Uploads a base64-encoded file to the VideoSDK temporary file storage.

The file is uploaded to the VideoSDK server associated with the current meeting room. On success, the listener receives a URL that can be shared with other participants (e.g., via PubSub) and later retrieved using fetchBase64File. Uploaded files are temporary and tied to the meeting session.

The operation is asynchronous. The listener callbacks are invoked on the main thread.

Code Example:


meeting.uploadBase64File(
    base64Data,   // base64-encoded file content
    token,        // authentication token
    "image.png",  // file name
    object : TaskCompletionListener<String, String> {
        override fun onComplete(fileUrl: String) {
            Log.d("Meeting", "File uploaded: " + fileUrl)
        }
        override fun onError(error: String) {
            Log.e("Meeting", "Upload error: " + error)
        }
    }
)

Parameters

base64Data

the base64-encoded file content

token

the VideoSDK authentication token (same token used for config)

fileName

the name of the file to upload (e.g., "image.png")

listener

the TaskCompletionListener to receive the uploaded file URL on success, or an error message on failure

See also