springboot+spring security+html+templates上传文件或者图片出现403
网上几种方法
这里介绍简单的
上传文件那个HTML文件加入这两行
<meta name="_csrf" th:content="${_csrf.token}"/>
<meta name="_csrf_header" th:content="${_csrf.headerName}"/>
注意是th:content,因为用的是templates模板
还有这里也要注意:也要加th:
<form th:action="upload" th:method="post" e
原创
2021-06-15 11:57:57 ·
260 阅读 ·
0 评论