In my Spring MVC project I am trying to upload a file via a simple form.
HTML Form:
The solution work for me is to disable csrf()
in my WebSecurityConfig
like :
@EnableWebSecurity
@Configuration
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.cors().and().csrf().disable();
}
}
And now i can simply upload multipart file :)