> ## Documentation Index
> Fetch the complete documentation index at: https://composio-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# RemoteFile

> Represents a file stored in a tool router session's file mount. Provides methods to fetch, save, and work with the file content.

## Usage

Access this class through the `composio.remoteFile` property:

```typescript theme={null}
const composio = new Composio({ apiKey: 'your-api-key' });
const result = await composio.remoteFile.list();
```

## Properties

| Name | Type | Description |
| - | - | - |
| `downloadUrl` | `string` | Presigned URL for downloading the file |
| `expiresAt` | `string` | ISO 8601 timestamp when the download URL expires |
| `mountRelativePath` | `string` | Relative path within the mount (e.g. "report.pdf") |
| `sandboxMountPrefix` | `string` | Absolute mount path inside the sandbox (e.g. /mnt/files) |

## Methods

### blob()

Fetches the file content as a Blob.

```typescript theme={null}
async blob(): Promise<Blob>
```

**Returns**

`Promise<Blob>` — The file content as a Blob

***

### buffer()

Fetches the file content as a buffer.

```typescript theme={null}
async buffer(): Promise<Uint8Array>
```

**Returns**

`Promise<Uint8Array>` — The file content as a Uint8Array

***

### save()

Downloads and saves the file to the local filesystem. Requires a Node.js runtime with file system support (not available in Cloudflare Workers/Edge).

```typescript theme={null}
async save(path?: string): Promise<string>
```

**Parameters**

| Name | Type | Description |
| - | - | - |
| `path?` | `string` | Local path to save the file. If omitted, saves to the Composio temp directory using the filename from the mount path. An existing default destination gets a copy number before its extension. |

**Returns**

`Promise<string>` — The absolute path where the file was saved

***

### text()

Fetches the file content as UTF-8 text.

```typescript theme={null}
async text(): Promise<string>
```

**Returns**

`Promise<string>` — The file content as a string

***

### parse()

Parses an API response (snake\_case) and returns a RemoteFile instance.

```typescript theme={null}
parse(data: unknown): RemoteFile
```

**Parameters**

| Name | Type | Description |
| - | - | - |
| `data` | `unknown` | Raw API response with snake\_case keys |

**Returns**

`RemoteFile` — A RemoteFile instance

***
