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

# Files and downloads

> Bring input files as uploads, ZIP archives, or URLs Gotenberg downloads.

Besides the files a method uploads (`html`, `files`, `assets`…), every route takes two more ways to bring files: `archives` and `downloadFrom`.

```typescript theme={null}
type RequestInputOptions = {
  archives?: PathLikeOrReadStream[]; // ZIP files Gotenberg unpacks
  downloadFrom?: DownloadFrom; // URLs Gotenberg downloads first
};
```

## Archives

Gotenberg unpacks each ZIP you pass in `archives`, and each entry counts as an uploaded file. A path keeps its base name; a `Buffer` or `ReadStream` is named `archiveN.zip`.

```typescript theme={null}
import { PDF } from "chromiumly";

const merged = await PDF.merge({ archives: ["path/to/chapters.zip"] });
```

## Download from URLs

`downloadFrom` lists URLs Gotenberg downloads before it starts, as if you had uploaded the files.

```typescript theme={null}
type DownloadFromEntry = {
  url: string; // an absolute http or https URL
  extraHttpHeaders?: Record<string, string>; // sent with the download
  filename?: string; // names the file
};

type DownloadFrom = DownloadFromEntry | DownloadFromEntry[];
```

Gotenberg names each file by its `filename`, else by the server's `Content-Disposition` header, else by the end of the URL path when it has an extension. Nothing naming the file is refused with a 400.

```typescript theme={null}
import { LibreOffice } from "chromiumly";

const buffer = await LibreOffice.convert({
  files: [],
  downloadFrom: [
    {
      url: "https://files.example.com/report.docx",
      extraHttpHeaders: { Authorization: "Bearer …" },
    },
    { url: "https://files.example.com/download?id=42", filename: "appendix.docx" },
  ],
});
```

## Use a downloaded file in a stage

A stage names a downloaded or unpacked file with `{ name }`:

```typescript theme={null}
const signed = await PDF.sign({
  files: ["path/to/contract.pdf"],
  downloadFrom: { url: "https://vault.example.com/company.p12", filename: "company.p12" },
  certificate: { name: "company.p12" },
  certificatePassword: "secret",
});
```

See [Stages — files a stage needs](https://docs.chromiumly.dev/stages.md#files-a-stage-needs).

Operators can turn downloads off, or restrict where they may go: see [Gotenberg – webhooks and downloads](https://gotenberg.dev/docs/webhook-download#restrict-the-destinations).


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