$file->extension()

Returns the file extension

Example

<?php echo $page->file()->extension();