# DownloadTask.abort

The call result of `downloadFile` will return a `downloadTask` object while being passed through the callback. The request task can be interrupted through the `abort` method of the object (`DownloadTask.abort()`).

## Support

This API only supports gadget calls, and the corresponding client version support is as follows.

App capability | Android | iOS | PC | Harmony | Preview
---|---|---|---|---|---
Gadget | **✓** | **✓** | **✓** | V7.35.0+ | Preview
Web app | **X** | **X** | **X** | **X** | /

## Input

None

## Output

None

##  Sample code

```js
const downloadTask2 = tt.downloadFile({"url":"https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.jj20.com%2Fup%2Fallimg%2Ftp05%2F19100120461512E-0-lp.jpg&refer=http%3A%2F%2Fimg.jj20.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1640079653&t=22aafb14cb145c11fc833022d61507c5"});
downloadTask2.abort(function(res) {
    console.log(JSON.stringify(res));
});
```

