# Adding a file

Add a file with the button, by dropping it onto the panel, or by pasting from the clipboard. All three take the same path: the bytes go to the file service, the file is validated before anything parses it, and only then does a reader run. A refused file is refused before extraction, so nothing half-processed is left behind.

- **Status:** Available
- **Audience:** both
- **In the app:** #/data
- **Last verified:** 2026-09-10
- **Canonical:** https://connectbyjbrh.com/docs/files-data/upload/

## The three ways in

| Method | Best for | What to know |
|---|---|---|
| The attach button | Anything you can find in a file dialogue | Multiple selection works; each file becomes its own row |
| Drag and drop | A file already visible on your desktop | Drop onto the panel, not onto the page behind it |
| Paste | A screenshot, or an image copied from another application | A pasted image arrives without a meaningful name, so rename it if you will need to find it later |

There is no difference in what happens afterwards. The method decides how the bytes reach the app and nothing else — the same validation, the same reader, the same row, the same audit entry.

## What happens in the first second

1. You attach the file.
   - Result: The bytes are sent to the file service. Nothing is parsed in your browser, so a malformed file cannot do anything to the page.
2. The workspace is resolved before storage.
   - Result: The row is stamped with your workspace from the moment it exists. There is no window in which an unstamped file row is visible to anyone.
3. The file is validated.
   - Result: The declared type is checked against the bytes, and the structural refusals are applied. [Validating a file](/docs/files-data/mime-validation/) covers what is checked.
4. A reader for the format runs.
   - Result: Text, tables or an image description come out, depending on the format. This is the step that makes the file answerable.
5. The file appears in the Files section, and in the tab if you added it there.
   - Result: It is now a versioned record you can ask about, link to a person or company, and change.

## What is accepted

Images as PNG, JPEG and WebP. Documents as PDF, DOCX and PPTX. Spreadsheets as XLSX, and delimited text as CSV or TSV. Plain formats as TXT, Markdown and JSON. Each has a reader that pulls out what that format actually carries, and [the formats page](/docs/files-data/supported-formats/) says exactly what comes out of each one.

What is not on that list is not read. An unsupported file may still be refused at the door rather than stored as an opaque blob, because a file nothing can read is a file nobody can answer from — and the refusal is more honest than a row that looks attached and cannot be used.

## What is refused, and why it is refused early

**A type that does not match its bytes** — A file named as one format whose contents are another. The bytes decide, not the extension.
**External entity declarations** — A document declaring entities that point outside itself. Refused before parsing, because parsing is the attack.
**A zip bomb** — An archive-backed format whose compressed contents expand out of all proportion. Refused on the ratio, not after the damage.
**An unreadable format** — Nothing here can extract from it, so storing it would produce a file that cannot be answered from.

All four are refused before extraction rather than during it. That ordering is the whole defence: a parser that has already started on hostile input is the thing the check exists to avoid, and stopping at the first sign of trouble is what makes the refusal cheap. [Parsing a file safely](/docs/files-data/safe-parsing/) sets out each refusal and what it protects.

> **Careful** A refusal is not a comment on your file's contents. Connect does not inspect what a document says in order to decide whether to accept it — the checks are structural, and a perfectly ordinary document is never refused for what it is about.

## Questions

### Where does a file go if I add it from an Assistant tab?

Into the same file workspace as one added anywhere else, and it is linked to the record that tab was working on. It is findable from the Files section and from that record, not only from the conversation.

### Can I add several files at once?

Yes, through the button or by dropping several together. Each becomes its own row with its own validation and its own version chain; there is no combined document.

### What happens if I add the same file twice?

You get two files, not two versions. A version belongs to a chain, and a new upload starts a new chain — to add a version, modify the existing file rather than uploading a replacement beside it.

## Related

- [Files and data in Connect](https://connectbyjbrh.com/docs/files-data/)
- [File formats Connect reads](https://connectbyjbrh.com/docs/files-data/supported-formats/)
- [Validating a file](https://connectbyjbrh.com/docs/files-data/mime-validation/)
- [The file was refused](https://connectbyjbrh.com/docs/troubleshooting/file-rejected/)
- [Uploading a file and answering from it, end to end](https://connectbyjbrh.com/docs/workflows/upload-and-answer/)

## What this page is based on

- `docs-source/sources/GENERAL.md` §9 — attachment by button, drop or paste; the refusals
- Connect capability registry (docs-source/facts.py) — `file_workspace`, `rls_isolation`
- `backend/app/file_workspace.py`, `file_formats.py` — storage and the readers
