[英]MultipartFile recieved null when using vs-upload to upload file in spring boot
I am using vs-upload to upload a file, this is the client code:我正在使用vs-upload上传文件,这是客户端代码:
<div class="vx-row">
<vs-upload data multiple="fasle" :headers="{'token' : token}" action="/service/zhuolian/report/org/user/import/list" @on-success="successUpload" />
</div>
and this is the spring boot(2.x) server side code:这是 spring boot(2.x) 服务器端代码:
@PostMapping("/list")
Response<SparkUserImportResponse> orgUserImport(@RequestBody MultipartFile file,
@RequestParam(required = false,value = "override",defaultValue = "false") Boolean override);
when I upload xlsx files in the browser, the server side received null MultipartFile.当我在浏览器中上传 xlsx 文件时,服务器端收到 null MultipartFile。 why the server side receive null?
为什么服务器端收到null? what should I do to fix this problem?
我应该怎么做才能解决这个问题?
add fileName file
for the upload component, the code looks like this:为上传组件添加fileName
file
,代码如下:
<div class="vx-row">
<vs-upload data fileName="file" multiple="fasle" :headers="{'token' : token}" action="/service/zhuolian/report/org/user/import/list" @on-success="successUpload" />
</div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.