I like to check if the uploaded file is for example an .GIF.
I tried the following but it’s not working. Any suggestions?
<?php if($file->type() === 'image/gif'): ?><?php endif ?>
I like to check if the uploaded file is for example an .GIF.
I tried the following but it’s not working. Any suggestions?
<?php if($file->type() === 'image/gif'): ?><?php endif ?>
$file->type()
returns the “type” in Kirby’s terminology: something like “image”, “document” or “archive”, etc.
You probably wanted to use $file->mime() === 'image/gif'
or $file->extension() === 'gif'
Relevant docs:
Thanks a lot