lian-yue / vue-upload-component

Vue.js file upload component, Multi-file upload, Upload directory, Drag upload, Drag the directory, Upload multiple files at the same time, html4 (IE 9), `PUT` method, Customize the filter
Apache License 2.0
2.68k stars 700 forks source link

:headers not used in chunk mode #425

Closed GinJus closed 2 years ago

GinJus commented 2 years ago

Hi,

For posting to a Laravel controller I need the X-CSRF-TOKEN token in the header. When :chunk-enabled is set to "false", the :headers variables are used but nut when it set to "true".

How come? I've also tried to add this: newFile.headers['X-CSRF-TOKEN'] = this.csrf; in the InputFilter.

Thanks.

lian-yue commented 2 years ago
 :chunk="{
   header:{"x-csrf-token": "xxx"},
 }

https://github.com/lian-yue/vue-upload-component/blob/master/src/FileUpload.vue#L59