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