I sit all day and don’t understand why it doesn't work. I have X-CSRF-TOKEN in the header. How do I get it? I tried it in different ways and no one method works.
Below is my Vue.js
<script>
import axios from "axios";
export default {
name: "UploadFiles",
data() {
return{
file: ""
}
},
methods:{
selectFile(){
this.file = this.$refs.file.files[0]
},
async sendFile() {
const formData = new FormData();
formData.append('file', this.file);
await axios.post('/user/uploadImages', formData)
}
}
}
</script>