Loading...

How can I pass file uploaded and pass parameter with axios on vue component?

					

let formData = new FormData();
formData.append('file', files[0]);
formData.append('product_id', this.productId);

axios.post(window.App.baseUrl+'/admin/product/upload-image', formData)
  .then(function(){
    console.log('SUCCESS!!')
  })
  .catch(function(){
    console.log('FAILURE!!')
  });

Leave a Reply

Your email address will not be published. Required fields are marked *