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

# fl_get_uri

> Extracts the uri field of a FILE value.

**Experimental feature**

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

Extracts the `uri` field of a [FILE](/documents/4.2/sql-reference/data-types/other-data-types/FILE.md) value.

## Syntax

```sql theme={null}
VARCHAR fl_get_uri(FILE file_expr)
```

## Parameters

`file_expr`: a FILE expression, such as the result of [to\_file](/documents/4.2/sql-reference/sql-functions/file-functions/to_file.md) or [try\_to\_file](/documents/4.2/sql-reference/sql-functions/file-functions/try_to_file.md).

## Return value

Returns a VARCHAR value. Returns NULL if the FILE value or the `uri` field is NULL. The field is returned unchanged, with no defaults. Empty strings are preserved.

## Examples

### Example 1: Extract the field

```sql theme={null}
SELECT fl_get_uri(to_file(named_struct('uri', 'https://example.com/a.jpg'))) AS uri;
```

```plaintext theme={null}
+---------------------------+
| uri                       |
+---------------------------+
| https://example.com/a.jpg |
+---------------------------+
```

### Example 2: The field is NULL

```sql theme={null}
SELECT fl_get_uri(to_file(named_struct('inline', to_binary('61', 'hex')))) AS uri;
```

```plaintext theme={null}
+------+
| uri  |
+------+
| NULL |
+------+
```

## keyword

FL\_GET\_URI, FILE


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