I am new to React Native and trying to upload Image with Axios but getting: Request failed with status code 500
I don't have backend problem because I can upload image with postman and everything is fine.
Here is my code, please help me if you know a solution, when I console log data, all the data are fine!!
const data = new FormData();
data.append('name', name);
data.append('childrenImage', childrenImage);
data.append('parent', parent)
console.log(data);
axios.post('http://192.168.0.24:3000/childrens/', data, {
headers: {
'Authorization': auth,
'accept': 'application/json',
'Content-Type': `multipart/form-data`
}
}
).then(res => {
console.log(res.data);
console.log(res.status);
})
.catch(err => {
console.log(err.message);
});