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

# Store generated files

> Store bytes a mutation produced or received at a label.

`ctx.store({ bytes, contentType })` stores bytes as a file at the frame's
label and returns its `File` point. Keep the point in a `t.file` field in the same
transaction; a file no committed fact keeps is retired by the host.

```ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
import { mutation, t, table } from "@bijectionhq/bijection";
import { finance, accountant } from "./access";

export const statements = table(
  { month: t.string, file: t.file },
  { label: finance, key: ["month"] },
);

export const keep = mutation(
  { under: finance, allow: [accountant], args: { month: t.string, csv: t.string } },
  async (ctx, { month, csv }) => {
    const file = await ctx.store({ bytes: csv, contentType: "text/csv" });
    await ctx.put(statements(month), { file });
    return file;
  },
);
```

`bytes` is a `Uint8Array`, a `Blob` or a string (stored as UTF-8). Pass
`sha256` (base64) to have the host check the bytes against a digest you
already hold.

The host seals every file. A protected file's key also depends on its
label's erasure units.

Pass `{ label }` to choose the file's place. A label above the frame's
commit label is a blind write. To store a copy for a lower audience, use
`ctx.store(input, { label, release })` and list the declared
[release](https://docs.bijection.com/access/disclosure.md#lowering-effects) in the function's `releases`.
The host reads a member release's member from the file's label.
The file carries the units of the values the
transaction opened, less what its table's `survives` declaration covers.

A sealed archive retains a File's original ID, generation, wrapped key and
absolute expiry. The destination verifies the File's label and protection
before it can publish a referring row. An authorized clear-copy release
can disclose the bytes for import as a new File.

In a test, `k.seed(sys.files, [{ bytes }])` stores a file as the installation on the
test kernel.


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