Closed
Description
Description
We could use the property mimeTypes
of the Symfony\Component\Validator\Constraints\File
to specify the attribute accepted
of the field
Example
in Symfony\Component\Form\Extension\Validator\ValidatorTypeGuesser
line 125
if ($constraint->mimeTypes){
return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\FileType', array('attr' => ['accept' => implode(', ', $constraint->mimeTypes)]), Guess::HIGH_CONFIDENCE);
}
return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\FileType', array(), Guess::HIGH_CONFIDENCE); ```