CQL field
fileExtension in CQL (Confluence): syntax, examples
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
| Argument | What it does |
|---|---|
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 titleLists the SVG files attached in a space, sorted by name, before a switch to a new icon set.
Run on Confluence Cloud on .
fileExtension in ("jpg", "jpeg", "png", "gif") AND type = attachmentFinds the raster images across all spaces, for example to check which ones need alt text or compression.
Run on Confluence Cloud on .
fileExtension != "svg" AND type = attachmentShows all attachments that are not SVG files.
Run on Confluence Cloud on .
fileExtension = "svg" AND created >= "2026-01-01"Finds SVG files uploaded this year.
Run on Confluence Cloud on .
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 .
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 withIN(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.filesizeis not in the field reference, but it works:filesize > 1000runs 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.