vuejs file
<v-form method="post" enctype="multipart/form-data">
<div v-if="!loading">
<v-card-text headline><h1>Please upload your documents</h1></v-card-text>
<v-layout row class="pt-1">
<v-flex xs12>
<v-subheader>Photo A</v-subheader>
</v-flex>
<v-flex xs12>
<input id="photoA" type="file" accept="image/*">
</v-flex>
</v-layout>
<v-layout row>
<v-flex xs12>
<v-subheader>Photo B</v-subheader>
</v-flex>
<v-flex xs12>
<input id="photo B" type="file" accept="image/*">
</v-flex>
</v-layout>
<v-layout row>
<v-flex xs12>
<v-subheader class="text-sm-left">Photo C Statement</v-subheader>
</v-flex>
<v-flex xs12>
<input id="photoC" type="file" accept="image/*">
</v-flex>
</v-layout>
<div v-html="error" />
<div>
<v-btn round block color="blue darken-3" dark large @click="submitDocs">Upload</v-btn>
</div>
</div>
</v-form>
script
submitDocs () {
console.log("submit docs clicked!")
const formData = new FormData()
formData.append('myFile', this.selectedFile, this.selectedFile.name)
axios.post('my-domain.com/file-upload', formData)
}
I am stucked in writing submitDocs. How do I do axios.post with photoA, photoB and photoC ? How do I get the file of photoA, photoB and photoC and upload it via axios.post ? Thank you in advance.
new FormData(formElm)then everything in the form will be copied intoformData