1👍
You can use FormData
to send files to the server.
<template>
<div id="app">
<input type="file" @change="onChange" />
</div>
</template>
<script>
export default {
name: "App",
methods: {
async onChange(event) {
const formData = new FormData();
formData.append("file", event.target.files[0]);
const response = await axios.post("xyzzy.com", formData);
console.log(response);
}
}
};
</script>
Source:stackexchange.com