更新时间:2021-11-04 06:45:20
您必须创建一个FormData对象并附加图像文件.
You have to create a FormData object and append the image file.
methods: {
'successUpload': function (file) {
let data = new FormData();
data.append('file', document.getElementById('file').files[0]);
axios.post('/Upload/File',data).then(function (response) {
console.log(response.data);
});
}
}
例如此处.
让我知道是否可行.