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

# autogen.tools.experimental.google.drive.drive_functions.download_file

<code class="doc-symbol doc-symbol-heading doc-symbol-function" />

#### download\_file

```python theme={null}
download_file(
    service: Any,
    file_id: str,
    file_name: str,
    mime_type: str,
    download_folder: Path,
    subfolder_path: str | None = None
) -> str
```

Download or export file based on its MIME type, optionally saving to a subfolder.

<b>Parameters:</b>

| Name              | Description                                        |
| ----------------- | -------------------------------------------------- |
| `service`         | **Type:** Any                                      |
| `file_id`         | **Type:** str                                      |
| `file_name`       | **Type:** str                                      |
| `mime_type`       | **Type:** str                                      |
| `download_folder` | **Type:** pathlib.Path                             |
| `subfolder_path`  | **Type:** str \| None<br /><br />**Default:** None |

<br />
