# fileExtension in CQL (Confluence): syntax, examples

URL: https://goingstellar.ro/reference/cql/fileextension-field/

The fileExtension field finds files by their extension, such as pdf or svg. Use it for attachment clean-ups, for example to list all images in a space or to find large PDFs. Write the extension in lower case and without the dot.

## Syntax

```
fileExtension = "svg"
fileExtension in ("pdf", "png", "json")
fileExtension != "svg"
```

## Arguments

- `value`: A file extension without the dot, in lower case. Quotes are optional for a simple value.

## Works with

- Operators: =, !=, IN, NOT IN (~ and !~ are rejected)
- Functions: none
- Related undocumented field: filesize, which accepts comparison operators

## Examples

```
fileExtension = "svg" AND type = attachment AND space = SD ORDER BY title
```

Lists the SVG files attached in a space, sorted by name, before a switch to a new icon set. Run on Confluence Cloud on 2026-11-29.

```
fileExtension in ("jpg", "jpeg", "png", "gif") AND type = attachment
```

Finds the raster images across all spaces, for example to check which ones need alt text or compression. Run on Confluence Cloud on 2026-11-29.

```
fileExtension != "svg" AND type = attachment
```

Shows all attachments that are not SVG files. Run on Confluence Cloud on 2026-11-29.

```
fileExtension = "svg" AND created >= "2026-01-01"
```

Finds SVG files uploaded this year. Run on Confluence Cloud on 2026-11-29.

```
filesize > 1000 AND fileExtension = "svg"
```

Finds SVG files larger than 1000 in the size unit of the field, a starting point for finding heavy files. Run on Confluence Cloud on 2026-11-29.

## Pitfalls

- The value is case-sensitive. `fileExtension = "svg"` finds the files, `fileExtension = "SVG"` runs and finds nothing. Convert names to lower case first, or list both spellings with `IN` (checked on Confluence Cloud, November 2026).
- Do not include the dot. `fileExtension = ".svg"` runs without an error and finds nothing.
- `fileExtension ~ "svg"` fails with: Operator '~' is not supported for field 'fileExtension'. There is no partial matching, so list every extension you want.
- `filesize` is not in the field reference, but it works: `filesize > 1000` runs and the unknown-field error lists it among valid names. The docs give no unit, so test with a known file before you rely on a threshold.

## Questions and answers

### How do I find pdf files?

Use `fileExtension = "pdf"`. Add `type = attachment` to make the intent clear.

## Related

- [type](https://goingstellar.ro/reference/cql/type-field/)
- [space](https://goingstellar.ro/reference/cql/space-field/)
- [IN](https://goingstellar.ro/reference/cql/in-operator/)
- [created](https://goingstellar.ro/reference/cql/created-field/)
- [title](https://goingstellar.ro/reference/cql/title-field/)
- [ORDER BY](https://goingstellar.ro/reference/cql/order-by/)

## Sources

- [CQL fields (Atlassian Developer, Confluence Cloud)](https://developer.atlassian.com/cloud/confluence/cql-fields/)

