跳到主要内容

DownloadTask.onProgressUpdate(function callback)

监听下载进度变化事件

参数​

function callback​

下载进度变化事件的回调函数

参数​

Object res​

属性类型说明
progressnumber下载进度百分比
totalBytesWrittennumber已经下载的数据长度,单位 Bytes
totalBytesExpectedToWritenumber预期需要下载的数据总长度,单位 Bytes