Vue.js - validation fails for file upload in axios when multipart/form-data used in header

前端 未结 2 1058
悲&欢浪女
悲&欢浪女 2020-11-29 13:06

I am building a Laravel+Vue.js SPA (Single Page Application) with BootstrapVue, VeeValidate and axios as the HTTP client.

Inside axios, when I use multipart/f

相关标签:
2条回答
  • 2020-11-29 13:24

    I guess using FormData API would work.

    Below some examples:

    How to post a file from a form with Axios axios post request to send form data

    0 讨论(0)
  • 2020-11-29 13:28

    I Recommend using VeeValidation for validating your form after submitting it.

    Its really simple and sweetest validation methods.

    You can install it from here. VeeValidation Link

    0 讨论(0)
提交回复
热议问题