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

# FILE

> FILE is a read-only scalar type that references a file, or a byte range of a file, through a fixed set of fields.

**Experimental feature**

[Advice on use of experimental features](/documents/4.2/maturity/features.md)

FILE is a scalar type that describes a file, or a byte range inside a file. A FILE value has a fixed set of fields that can be extracted using the `FL_GET_*` functions.

FILE currently cannot be persisted in the database. FILE values can be obtained from external catalogs or constructed using `TO_FILE` or `TRY_TO_FILE`. For syntax and examples, see [FILE functions](/documents/4.2/sql-reference/sql-functions/file-functions/file-functions.md).

## Structure

Every FILE value carries the same fields, in this order. Each field can be NULL.

| Field | Type | Description |
| - | - | - |
| `uri` | VARCHAR | Location of the file, for example an object storage or HDFS path. |
| `offset` | BIGINT | Byte position inside the file where the referenced content starts. |
| `size` | BIGINT | Number of bytes of the referenced content, counted from `offset`. |
| `content_type` | VARCHAR | Media type of the content, such as `image/png`. |
| `checksum` | VARCHAR | Checksum of the referenced content. |
| `inline` | VARBINARY | The content itself, stored directly in the value instead of being referenced through `uri`. |

A FILE value is one of the following:

* A **reference**: `uri` is set, usually together with `offset` and `size`, and `inline` is NULL.
* **Inline content**: `inline` holds the bytes; `uri`, `offset`, and `size` must all be NULL.

## Output format

A FILE value is rendered as a JSON-like object that lists all fields:

```plain text theme={null}
{"uri":"s3://bucket/images/a.png","offset":4,"size":8,"content_type":null,"checksum":null,"inline":null}
{"uri":null,"offset":null,"size":null,"content_type":null,"checksum":null,"inline":"89504e470d0a1a0a"}
```

The `inline` bytes are encoded according to the session variable [`binary_encoding_format`](/documents/4.2/sql-reference/System_variable#binary_encoding_format).

## Limitations

* FILE cannot be used as a column type in CREATE TABLE, CREATE TABLE AS SELECT, or materialized views.
* FILE values cannot be compared, sorted, grouped, joined on, used with DISTINCT, cast to or from other types, or passed to window functions.
* `IS NULL` and `IS NOT NULL` are supported.


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