file upload using Axios in React
I am uploading a file in React using Axios.
When I am doing
alert(values.attachedFile[0]);, it displays:
but when I am sending values.attachedFile[0] in an Axios post request, an empty object is being sent.
const { result } = await axios.post(app.resourceServerUrl + '/file/upload', {
data: values.attachedFile[0],
headers: {
'Content-Type': 'multipart/form-data',
},
});
You can see the request data being empty:
What is my mistake?

