vendredi 23 octobre 2020

Upload Multiple images in Laravel using Vue.js

I'm trying to upload image using vue.js in Laravel for that i'm using this link

https://jsfiddle.net/b412ruzo/

to upload image using vue.js and when i submit the form i'm getting following image in files array

enter image description here

now issue is that i cannot get this file array in laravel controller

when i print

$request->file('files') 

in my controller i am getting null. and when i print $request->input('files') this is the result, an empty array

enter image description here

Any help regarding this issue is highly appreciated.

Code Snippet :

data() {
     return {
    rawData: [],
    formData: new Form({
        files:[],
})
..

  const header = {
             Authorization: "Bearer " + this.token,
            };
  this.formData
        .post(APP_URL + `/api/post`, { headers: header })
        .then((response) => {

   }


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire