在我的Symfony应用程序中,我想在文件上传期间仅将zip和rar文件设置为mime类型,但它不起作用我试过这段代码
/* * @Assert\File(
* maxSize = "1024k",
* mimeTypes = {"application/zip,application/octet-stream
* application/rar,application/octet-stream"},
* mimeTypesMessage = "dossier sur form zip"
* )
*/
public $file;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
public $path;