Skip to content
Advertisement

Exporting formData from React to Spring boot backend

React code for build jsonBlob object

JavaScript

Spring boot backend that accepts for frontend request

JavaScript

I want to figure out when I called the function from the frontend it’s working properly but I change the state its doesn’t send the object to the backend while the file appears in the directory. if I delete the file then only send it again and save it on the directory. How I save multiple files while doesn’t delete the previous ones

Thank you very much for your time and effort.

Advertisement

Answer

In React application I used props to pass the file name from a different state and make sure to remove,

JavaScript

Main function in React,

JavaScript

And back end code I used same to get the original name then Its appears with the right name.

JavaScript

Chears !!

Advertisement