Continue work on FileUpload. Created FileController

This commit is contained in:
Torsten 2020-02-05 17:04:01 +01:00
parent b93f0254a6
commit 0263c0f838
5 changed files with 69 additions and 7 deletions

View file

@ -125,6 +125,16 @@
onFileSelected(event) {
console.log("File changed:");
console.log(event.target.files[0].name);
const fd = new FormData();
fd.append('image',event.target.files[0],event.target.files[0].name);
axios.post('http://localhost:8000/api/v1/auth/upload',fd,{
headers: {
'Authorization': 'Bearer ' + this.$store.state.user_token
}
})
.then(res=>{
console.log(res);
})
}
}
}