[Vuejs]-Vuejs vuesax upload image issue?

0👍

You have to use action (where you want to send the files) and fileName (the name under which you want to send the files) attributes.

ex:

      <vs-upload multiple automatic text="Drag you photos here" action="/api/upload" fileName='photos[]' @on-success="successUpload" @on-error="errorUpload"/>

I use laravel and vue.js and in laravel’s controller I check $request[‘photos’] where I will have as many elements in the array as many files I uploaded

From the controller you can return the filepaths (if you want) and you will catch them in vue.js successUpload() action like in the following example:

methods: {
    successUpload (event) { 
      //notify
      this.$vs.notify({ color: 'success', title: 'Upload Success' })

      //get the filePaths from Laravel controller
      let filePaths = event.currentTarget.response

      //do something with the file paths...
    },

Also check the API of vuesax upload component.

Hope that helps.

Leave a comment