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

# Multiple Files

> Patterns for collecting multiple files with Formbase.

Formbase stores a single `file` URL (and optionally a single `image` URL) per submission. If you need to collect multiple files, you have two good options:

1. Submit multiple times (one file per submission), or
2. Upload files to your own storage and send the resulting URLs to Formbase as JSON.

The second option gives you full control and keeps the Formbase submission clean and structured.

<Steps>
  <Step title="Upload files to your storage">
    Use a dedicated upload endpoint or direct-to-storage upload flow. Collect the URLs in your client or server.
  </Step>

  <Step title="Send the URLs to Formbase">
    ```ts theme={null}
    const payload = {
      name: 'Ada Lovelace',
      attachments: [
        'https://cdn.example.com/uploads/resume.pdf',
        'https://cdn.example.com/uploads/portfolio.pdf',
      ],
    };

    await fetch('https://formbase.dev/s/YOUR_FORM_ID', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify(payload),
    });
    ```

    This keeps multiple files together as a single submission field.
  </Step>
</Steps>

<Callout type="note">
  If you submit multiple file inputs in a single `multipart/form-data` request, Formbase keeps only one `file` and one `image` URL.
</Callout>
