Hello! Is there a better way to track progress of ...
# ktor
m
Hello! Is there a better way to track progress of content download? Currently I'm using this code:
Copy code
kotlin
val call = httpClient.call {
    url(...)
    method = HttpMethod.Get
}
localFile.writeChannel().use {
    val content = call.response.content
    var readLast: Long
    do {
        readLast = content.copyTo(this, 8192)
        updateProgress(readLast)
    } while (readLast > 0)
}
👌 1