> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rebellapp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# my.downloadFile

> Download a file from a remote server.

Download a file and save it locally.

## Parameters

| Property | Type     | Required | Description                   |
| -------- | -------- | -------- | ----------------------------- |
| url      | String   | Yes      | File URL to download          |
| header   | Object   | No       | Request headers               |
| success  | Function | No       | Callback on success           |
| fail     | Function | No       | Callback on failure           |
| complete | Function | No       | Callback that always executes |

## Success Callback

| Property   | Type   | Description                     |
| ---------- | ------ | ------------------------------- |
| apFilePath | String | Temporary file storage location |

## Error Codes

| Error | Description        |
| ----- | ------------------ |
| 12    | Downloading failed |
| 13    | No right           |

## Code Example

```javascript theme={null}
my.downloadFile({
  url: 'https://example.com/file.pdf',
  success: (res) => {
    console.log('Downloaded to:', res.apFilePath);
  }
});
```
