The CSRF token is invalid. Please try to resubmit the form

后端 未结 15 1674
粉色の甜心
粉色の甜心 2020-11-28 10:38

I\'m getting this error message every time I try to submit the form:

The CSRF token is invalid. Please try to resubmit the form

15条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-28 10:48

    In my case I got a trouble with the maxSize annotation in the entity, so I increased it from 2048 to 20048.

     /**
     * @Assert\File(
     *     maxSize = "20048k",
     *     mimeTypes = {"application/pdf", "application/x-pdf"},
     *     mimeTypesMessage = "Please upload a valid PDF"
     * )
     */
    private $file;
    

    hope this answer helps!

提交回复
热议问题