---
name: "DownloadTask.offProgressUpdate"
mode: "kit"
versionRequirements:
  - { name: "BaseKit", version: "2.0.1" }
platform:
  - "iOS"
  - "Android"
---

## DownloadTask.offProgressUpdate

> [VERSION] BaseKit >= 2.0.1

> [PLATFORM] iOS, Android

### Description

Stop listening for download progress change events

### Parameters

`(listener: Function)`

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `listener` | `(params: Object) => void` | Yes | - | Event listener callback function |

##### DownloadTask.offProgressUpdate.listener(params) properties

| Property | Type | Required | Default | Since | Description |
| --- | --- | --- | --- | --- | --- |
| `progress` | `number` | Yes | - | `2.0.1` | Download progress percentage |
| `totalBytesSent` | `number` | Yes | - | `2.0.1` | Downloaded data length, in Bytes |
| `totalBytesExpectedToSend` | `number` | Yes | - | `2.0.1` | Total expected data length to download, in Bytes |
| `requestId` | `string` | Yes | - | `2.0.1` | Network request ID |


### Examples

#### Demo

```tsx
import { downloadFile } from '@ray-js/ray'

// Remove the progress listener: first get the download task handle via ty.downloadFile, then register and remove the progress listener on the handle.
const downloadTask = await downloadFile({
  url: "https://airtake-public-data-1254153901.cos.ap-shanghai.myqcloud.com/ttttestfile/test_video.mp4",
});

const handler = e => {
  console.log(e);
};
downloadTask.onProgressUpdate(handler);
downloadTask.offProgressUpdate(handler);
```
