upload

fun FTPClient.upload(remotePath: String, content: Flow<ByteArray>, dispatcher: CoroutineDispatcher = Dispatchers.IO): Flow<Unit>

Uploads a file to the remote FTP server specified by remotePath using the specified content.

content is a Flow that emits byte arrays that represent the content of the file to be uploaded.

Returns a Flow that emits a single Unit value once the file has been uploaded.

Example usage:

val content = flowOf(byteArrayOf(0x01, 0x02, 0x03))

ftpClient.upload("/path/to/remote/file", content).collect {
// File has been uploaded
}