Answer the question
In order to leave comments, you need to log in
What is the correct way to upload a file via axios to s3?
What is - a request with the id of the picture goes to the backend, the name for the picture and a link for put are received in response.
What is missing is an understanding of why exactly it does not work.
I use the method to send
function upload(url, image) {
const formData = new FormData();
formData.append("image", image);
formData.append("Content-Type", "image/jpeg");
return server.axios.put(url, formData, {
headers: {
"Content-Type": "multipart/form-data"
}
});
}
const image = {
uri: file.path,
type: "image/jpeg",
name: newName
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question