I want to upload image and upload to server. how can i get a file and can read in server?
const takePhotoFromLibraryProfile = () => {
ImagePicker.openPicker({
width: 200,
height: 200,
cropping: true,
}).then(image => {
setImageProfile(image.path);
});
};
and this my axios post
axios({
crossDomain: true,
method: 'post',
url: 'url',
data: {
userId: dataProfile.id,
pictures: imageProfile,
},
validateStatus: false,
})
.then((response, status) => {
console.log(response);
setSuccessModal(response.status);
})
.catch(function (error) {
console.log(error);
// need handling error
});
};
i got the respon and also false but in develop web can upload the image. Thank you