{% set imageFilters = [ 'image/jpg', 'image/jpeg', 'image/png' ] %} {% set otherFilters = [ 'text/plain', 'pdf' ] %} {# {% set otherFilters = ['text/plain', 'pdf', 'doc', 'docx', 'xls', 'csv', 'xlsx'] %} #} {% if item.encodingFormat is defined and item.encodingFormat in imageFilters %} {# the second parameter is the name of the property with the UploadableField annotation #}