Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
since no one answers, I don’t really remember angular
like this in vue, do it by analogy:
<form>
<div class="form-group">
<label for="InputFile">File input</label>
<input type="file" id="InputFile" @change="onFileChange">
<p class="help-block">Upload image</p>
</div>
</form>
onFileChange (e) {
let file = e.target.files[0] || e.dataTransfer.files[0]
let formData = new FormData()
formData.append('image', file)
this.$http.post('upload/', formData)
.then(response => {
console.log(response)
}, error => {
console.log(error)
})
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question