public function validateSubmitValue($value) {

        if (empty($value)) {
            return;
        }

        $filetypesutil = new \core_form\filetypes_util();
        $whitelist = $filetypesutil->normalize_file_types($this->_options['accepted_types']);

        if (empty($whitelist) || $whitelist === ['*']) {
            // Any file type is allowed, nothing to check here.
            return;
        }

        $draftfiles = file_get_all_files_in_draftarea($value);
        $wrongfiles = array();

        if (empty($draftfiles)) {
            // No file uploaded, nothing to check here.
            return;
        }

        foreach ($draftfiles as $file) {
            if (!$filetypesutil->is_allowed_file_type($file->filename, $whitelist)) {
                $wrongfiles[] = $file->filename;
            }
        }

        if ($wrongfiles) {
            $a = array(
                'whitelist' => implode(', ', $whitelist),
                'wrongfiles' => implode(', ', $wrongfiles),
            );
            return get_string('err_wrongfileextension', 'core_form', $a);
        }

        return;
    }