# Attachment Downloads

The Stream Chat SDK supports uploading photos, audio, voice recordings, videos, and other file types. Uploaded files are represented as message attachments. The SDK also provides a convenient way to download these attachments to the device's public Downloads directory using Android's `DownloadManager`.

## Downloading Attachments

Use the `ChatClient.downloadAttachment()` extension function to download an attachment:

```kotlin
public fun ChatClient.downloadAttachment(
    context: Context,
    attachment: Attachment,
): Call<Unit>
```

### Parameters

| Parameter    | Description                          |
| ------------ | ------------------------------------ |
| `context`    | The Android context.                 |
| `attachment` | The `Attachment` object to download. |

### Basic Usage

```kotlin
val attachment: Attachment = message.attachments.first()

ChatClient.instance().downloadAttachment(
    context = context,
    attachment = attachment,
).enqueue { result ->
    when (result) {
        is Result.Success -> {
            // Download started successfully
        }
        is Result.Failure -> {
            // Handle error
        }
    }
}
```

### Default Behavior

The download:

- Saves to the public `Downloads` directory (`Environment.DIRECTORY_DOWNLOADS`)
- Uses the attachment's name, title, or a fallback name derived from the URL
- Shows a notification when the download completes (`VISIBILITY_VISIBLE_NOTIFY_COMPLETED`)


---

This page was last updated at 2026-08-10T16:00:43.160Z.

For the most recent version of this documentation, visit [https://getstream.io/chat/docs/sdk/android/client/attachment-downloads/](https://getstream.io/chat/docs/sdk/android/client/attachment-downloads/).