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

# Files from visitors

> Let website and app visitors send the agent a photo or a PDF

Visitors can send the agent a photo or a PDF, with an optional caption. The agent reads it and answers, and your team sees it in the Inbox. It works for anonymous visitors and for logged-in users, on the website and in your app.

| SDK | From |
| - | - |
| Flutter (`osvi_chat`) | 0.3.0 |
| Web (`@osvi-ai/chat`) | The next web SDK release |

WhatsApp and Instagram are not affected: visitors there could already send files, and these switches do not change that.

## Turn it on

Three switches must all be on. Until they are, the chat looks and behaves as before, with no attach button.

**1. Chat attachments for the account**

The account feature `chat_attachments`. Osvi AI switches it on: ask Osvi AI support.

**2. Media reading for the account**

The account feature `process_media`, which lets agents read photos and documents. Osvi AI switches this on too, through support.

**3. Files from visitors for the agent**

In the chat agent, open **Channels → Web widget**, switch **Files from visitors** on, choose **Photos**, **PDFs** or both, and press **Save**.

**Files from visitors** appears in the dashboard only once `chat_attachments` is on. If `process_media` is still off, the section shows "Media reading is off for this account, so visitors won't see the attach button yet."

Checklist when the paperclip does not show:

* [ ] Osvi AI has switched on `chat_attachments` for the account.
* [ ] Osvi AI has switched on `process_media` for the account.
* [ ] **Files from visitors** is on for this agent, with at least one of **Photos** and **PDFs**, and saved.
* [ ] The app uses Flutter SDK 0.3.0 or later, or the website uses a web SDK release with attachments.
* [ ] The page was reloaded, or the app restarted, after saving. The chat reads the setting when it loads.

Anonymous visitors also need **Anonymous usage** on and an allowed website, as for any anonymous chat. See [Dashboard settings](https://docs.osvi.ai/website-chat/dashboard-settings.md).

## What visitors can send

| Kind | Types | Up to | What the agent reads |
| - | - | - | - |
| Photos | JPEG, PNG, WebP | 5 MB | The picture |
| PDFs | PDF | 10 MB | The first page |

* **One file per message.** The caption is optional.
* **The file's contents decide its type**, not its name. A text file renamed `photo.png` is refused.
* The SDKs check the type and size before uploading, and the server checks again.

## What visitors see

* **A paperclip** in the message field. In the Flutter SDK it offers **Photo library**, **Take a photo** (on iOS and Android) and **Document (PDF)**. On the web it opens the browser's file chooser, which on a phone offers the camera too.
* **A preview** above the message field before sending: a thumbnail or PDF icon, the name, the size, and an ✕ to remove it. What the visitor types becomes the caption, and Send works without text.
* **In the conversation,** a photo shows in the bubble and opens full screen when tapped. A PDF shows its name, "PDF" and its size, with the caption under it, and opens when tapped.
* **A file that is too large or of the wrong type** is refused on the device, with the reason, before anything is uploaded.
* **An old file** shows "This file is no longer available" once it has been deleted (see below).

## In the Inbox

Your team sees the photo or PDF in the conversation, shown like a WhatsApp photo or document, with the visitor's caption.

## Privacy

* **Photos leave the device without their location.** The Flutter SDK resizes photos to at most 2048 px and removes EXIF (including GPS position and camera details), XMP and IPTC metadata before uploading, whichever picker supplied them; only the orientation is kept. The web SDK shrinks photos to at most 2048 px and re-encodes them as JPEG, which drops EXIF and GPS data; small PNG and WebP files are sent as they are.
* **Files are never public.** Visitors open them through a signed link on the Osvi AI API that lasts about an hour. The SDKs fetch a fresh link when an old one has expired.
* **Files are deleted after 90 days.** The message and its caption stay; the file shows as no longer available.

## Limits

| Limit | Value |
| - | - |
| Photo size | 5 MB |
| PDF size | 10 MB |
| Files per message | 1 |
| Uploads per conversation | 20 an hour |
| Uploads per visitor IP | 60 an hour |

A message with a file also counts toward the message limits of anonymous chats. See [Security and limits](https://docs.osvi.ai/website-chat/security.md#limits).

## For developers

* **Flutter:** the built-in pickers, your own picker, and the iOS and macOS setup are in [Customise](https://docs.osvi.ai/flutter/customise.md#photos-and-pdfs). `sendAttachment` is in the [headless client](https://docs.osvi.ai/flutter/headless.md#methods).
* **Web:** `sendAttachment` is in the [headless SDK](https://docs.osvi.ai/website-chat/headless.md#methods-and-outcomes).
* **Custom clients:** the upload and the message frame are in [WebSocket Integration](https://docs.osvi.ai/api-reference/chat-websocket.md#sending-a-file).
* **Errors:** the refusals are in [Error codes](https://docs.osvi.ai/website-chat/error-codes.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.