当使用VichUploaderBundle上传任何文件时,此断言正在传递Symfony的表单验证:
/** * @Vich\UploadableField(mapping="product_media", fileNameProperty="path") * @Assert\File( * mimeTypes = {"image/jpeg", "image/gif", "image/png", "video/mp4", "video/quicktime", "video/avi"}, * mimeTypesMessage = "Wrong file type (jpg,gif,png,mp4,mov,avi)" * ) * @var File $pathFile */ protected $pathFile;
我看不出断言的问题.如何使用VichUploader验证文件类型?