I want to Upload File To Spring boot backend , How should I send Formdata as requestparam in postrequest, i tried following code
angular service class code
let headers=new HttpHeaders({
'Content-Type="multipart/form-data'
})
const formData:FormData=new FormData();
formdata.apend('file',file);
return this.http.post(uploaadfile,{params:{
file:formData,
contracttemplateid:28
}},options);
spring boot controller code
@postmapping
uploadfile(@requestparam("file") MultipartFile
file,@requestparam("contracttemplateid") long id)
{
}