libtd-ktx / kotlinx.telegram.extensions / FileKtx / cancelDownload
cancelDownload
open suspend fun File.cancelDownload(onlyIfPending: Boolean): Unit
Suspend function, which stops the downloading of a file. If a file has already been downloaded, does nothing.
Parameters
onlyIfPending - Pass true to stop downloading only if it hasn’t been started, i.e. request
hasn’t been sent to server.