> ## 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.

# Interface: FilesReader

> ctx.files in queries.

[server](/api/modules/server).FilesReader

`ctx.files` in queries.

## Hierarchy

* **`FilesReader`**

  ↳ [`FilesWriter`](/api/interfaces/server.FilesWriter)

## Methods

### inspect

▸ **inspect**(`file`): `Promise`\<[`FileInfo`](/api/modules/values#fileinfo)>

The metadata of a file, read through its locator. A protected file needs
the route it is read through (`attachment(record, field)`), decided as
delivery decides it, unless this transaction accepted it; its native row
and current source permissions are read dependencies, so an erasure
racing this transaction refuses its result or commit. Missing, erased
and unauthorized files, and a protected file named without a route,
throw `FileUnavailable`; an attachment whose field now names another
file throws `FileAttachmentChanged`. An ordinary file needs no route.

#### Parameters

| Name | Type |
| :- | :- |
| `file` | [`AttachmentLocator`](/api/modules/files#attachmentlocator) \| [`FileRef`](/api/modules/values#fileref) |

#### Returns

`Promise`\<[`FileInfo`](/api/modules/values#fileinfo)>

***

### isAvailable

▸ **isAvailable**(`file`): `Promise`\<`boolean`>

Logical availability in this component's file namespace, including all
ancestor erasure barriers. Reveals no metadata, permissions or byte
capability; it does not probe physical blob existence.

#### Parameters

| Name | Type |
| :- | :- |
| `file` | [`FileRef`](/api/modules/values#fileref) |

#### Returns

`Promise`\<`boolean`>

***

### erasure

▸ **erasure**(`erasure`): `Promise`\<[`FileErasure`](/api/modules/server#fileerasure) | `null`>

The progress of an accepted erasure of this component's file, read
from durable state, or null when the reference names none. Reveals no
digest, size, name or byte capability.

#### Parameters

| Name | Type |
| :- | :- |
| `erasure` | [`ErasureRef`](/api/modules/server#erasureref) |

#### Returns

`Promise`\<[`FileErasure`](/api/modules/server#fileerasure) | `null`>

***

### inspectWorkloadGrant

▸ **inspectWorkloadGrant**(`file`, `options`): `Promise`\<[`WorkloadGrantInfo`](/api/interfaces/server.WorkloadGrantInfo)>

This component's live workload grant of a file under the exact key.
Current source permissions and erasure are read dependencies. Returns
no URL or secret and never renews a delivery; suitable for queries and
operation review.

#### Parameters

| Name | Type |
| :- | :- |
| `file` | [`FileRef`](/api/modules/values#fileref) |
| `options` | `Object` |
| `options.key` | `string` |

#### Returns

`Promise`\<[`WorkloadGrantInfo`](/api/interfaces/server.WorkloadGrantInfo)>


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