in ionic i try to upload image after i take it by camera plugin to my server in spring boot but i get error when i send Form Data in API
my code :
private readFile(file: any): void {
let reader = new FileReader();
reader.onloadend = () => {
const formData = new FormData();
if (reader.result) {
const imgBlob = new Blob([reader.result], {type: file.type});
formData.append('file', imgBlob, file.name);
this.service.uploadtoserver(formData).subscribe(res=>{
})
}
};
reader.readAsArrayBuffer(file);
}
uploadtoserver(fd : FormData)
{
const url = `${'http://localhost:8090/api/document/upload'}`;
return this.http.post(url,fd, this.httpOptions)
.pipe(map(response =>response));
}
i get this error when i excute my API :

