# File

> > This page is auto-generated from the formations OpenAPI spec.
> Do not edit manually — run `pnpm generate-formations-resource-docs` to regenerate.

# File

> This page is auto-generated from the formations OpenAPI spec.
> Do not edit manually — run `pnpm generate-formations-resource-docs` to regenerate.

Registers a file record within the formation's project.

## Syntax

```yaml
type: file
properties:
  prefix: String
  filename: String
  content_type: String
  size: Integer
  metadata: String
```

## Output

The physical resource ID is the **public ID** of the created resource. Reference it from other resources with a `ref` expression:

```yaml
      some_field:
        ref: MyFile
```

## Properties

**`prefix`**

Directory within the project. Optional; defaults to / (root). Combined with filename to form the file's key (path).

_Required_: No
_Type_: String
_Nullable_: Yes

---

**`filename`**

Original / download name and the key's leaf segment.

_Required_: No
_Type_: String
_Nullable_: Yes

---

**`content_type`**

MIME type of the file

_Required_: No
_Type_: String
_Nullable_: Yes

---

**`size`**

File size in bytes

_Required_: No
_Type_: Integer
_Nullable_: Yes

---

**`metadata`**

JSON string with additional metadata

_Required_: No
_Type_: String
_Nullable_: Yes

---
