简体   繁体   English

在 spring 引导中使用 vs-upload 上传文件时,MultipartFile 收到 null

[英]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.

相关问题 上传文件时,Spring REST MultipartFile文件始终为null - Spring REST MultipartFile file is always null when do upload file 在Spring 2.5中使用MultipartFile上传文件中的null值 - null value in file upload by using MultipartFile in spring 2.5 Spring MultipartFile上传文件位置 - Spring MultipartFile upload file location 使用MultipartFile的多个文件上传在Spring Boot中不起作用,从JSP在Controller中获取空数组 - Multiple file upload using MultipartFile not working in Spring Boot , getting empty array in Controller from JSP 使用Spring MultipartFile和谷歌应用引擎上传文件 - upload a file using spring MultipartFile and google app engine 对于大于 150kb 的文件上传请求参数为 null,使用 multipartfile 上传,Spring 3.2,wildfly 9.0.0 - request parameters null for file upload greater than 150kb with multipartfile upload, Spring 3.2, wildfly 9.0.0 在 Spring Boot 2.1 MultipartFile - 启用 SSL(https)时上传文件时,几乎 50% http 400 bad request error - Got almost 50% http 400 bad request error on Spring Boot 2.1 MultipartFile - file upload when enable SSL(https) Spring 3.0 MultipartFile上传 - Spring 3.0 MultipartFile upload 使用Spring Boot的Spring Rest:将MultipartFile和Json对象作为参数上传 - Spring rest with Spring Boot: Upload MultipartFile and Json object as parameters 空列表<MultipartFile>尝试使用 ng-file-upload 在 Spring 中上传许多文件时 - Empty List<MultipartFile> when trying to upload many files in Spring with ng-file-upload
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM