[Vuejs]-How to send image through ajax (axios with vue.js) to controller and how to access it afterwards?

0👍

Okay, the reason I couldn’t access those images were due to their size. I fixed it by changing some lines in php.ini. So I set: filememory_limit to 256M and upload_max_filesize to 10M. Now it all works fine!

0👍

Try to add an options object and set the header:

    axios.post('/uploadImg', {
      formData
   }, {headers: {'content-type': 'multipart/form-data'}})

Leave a comment