Continue work on FileUpload. Created FileController
This commit is contained in:
parent
b93f0254a6
commit
0263c0f838
5 changed files with 69 additions and 7 deletions
|
|
@ -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);
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue