getValue('mimetype')); if ($exploded_mime[0] != 'audio') { $form_state->setErrorByName( 'mimetype', t('Please enter a audio mimetype (e.g. audio/mpeg, audio/m4a, etc...)') ); } } }