Search code snippets, questions, articles...

Upload Image & File

const form = new FormData();
form.append('image', {
 name: 'image',
 type: 'image/jpeg',
 uri: data.uri,
});
 axios
 .post(`${URL}/api/v1/uploads/image`, form)
 .then(function (response) {
 })
 .catch(function (error) {
   console.log('err', error.response.data);
 });
Was this helpful?
0 Comments
Programming Feeds
Learn something new everyday on Devsheet