背景:前端使用vue + ElementUI,并使用ElementUI里面upload控件将图片上传至ABP接口服务端
后端使用ABP框架,并希望在ABP中接收前端发送过来的图片
问题:ABP服务端怎样接收前端发过来的图片呢,求相关的参考代码
下面是前端代码
<el-upload
class="upload-demo"
ref="upload"
action="https://jsonplaceholder.typicode.com/posts/"
:on-preview="handlePreview"
:on-remove="handleRemove"
:file-list="fileList"
:auto-upload="false">
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
<el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传到服务器</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>
</el-upload>
<script>
export default {
data() {
// 省略
},
methods: {
submitUpload() {
this.$refs.upload.submit();
}
}
}
</script>