当前位置:网站首页>上传文件(post表单提交form-data)
上传文件(post表单提交form-data)
2022-06-12 06:26:00 【Stack Piston】
@RequestMapping("/importScheduling")
// public R importScheduling(@RequestParam(value = "excelFile") MultipartFile mFile) {
@RequestMapping("/importScheduling")
public R importScheduling(HttpServletRequest request) {
String jobNum = getUser().getJobNum();
MultipartFile mFile = null;
if (request instanceof StandardMultipartHttpServletRequest) {
MultiValueMap<String, MultipartFile> fileMap = ((StandardMultipartHttpServletRequest) request).getMultiFileMap();
mFile = fileMap.get("excelFile").get(0);
}
logger.info("===接受到文件[{}]",mFile==null?null:mFile.getSize());
//月份
String month = request.getParameter("time");
logger.info("===接受到month[{}]",month);
//groupId
Integer groupId = Integer.valueOf(request.getParameter("groupId"));
@ApiOperation("上传")
@PostMapping("/uploads")
public R uploads(
@ApiParam(name = "file", value = "文件", required = true, type = "form")
@RequestParam("file") MultipartFile file,
@ApiParam(name = "", value = "", type = "query")
@RequestParam(name = "cwId", required = true, defaultValue = "") Integer cwId,
@ApiParam(name = "", value = "", type = "query")
@RequestParam(name = "openId", required = true) String openId,
@ApiParam(name = "hrId", value = "号", type = "query")
@RequestParam(name = "hrId", required = true) String hrId) {
————————————————
版权声明:本文为CSDN博主「Stack Piston」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/CW_SZDX/article/details/123721349调用上传文件接口报错“the request was rejected because no multipart boundary was found”
解决:桌面存在同名文件?换个文件夹放,重选文件,就正常了。
边栏推荐
- (UE4 4.27) add globalshder to the plug-in
- About session Getattribute, getattribute error
- Nodemon cannot load the file c:\users\administrator\appdata\roaming\npm\nodemon PS1, because script execution is prohibited in this system
- Unity3d multi platform method for reading text files in streamingasset directory
- LeetCode-2034. Stock price fluctuation
- Remap function of C different interval mapping
- UE4 4.27 modify the mobile forward pipeline to support cluster multi light source culling
- C2w model - language model
- leetcode 35. Search insert location
- Storing texture2d to hard disk JPG file with script under unity3d
猜你喜欢

Understand Houdini's (heightfield) remap operation

Touch screen setting for win7 system dual screen extended display

Cause analysis of motion blur / smear caused by camera shooting moving objects

Redis basic notes

Leetcode personal question solution (Sword finger offer3-5) 3 Duplicate number in array, 4 Find in 2D array, 5 Replace spaces

Bulk Rename Utility

2021 RoboCom 世界机器人开发者大赛-本科组(初赛)

Opencv_100问_第五章 (21-25)

Qt-- realize TCP communication

MNIST handwritten data recognition by RNN
随机推荐
Univariate linear regression model
PHP read / write cookie
Understand Houdini's (heightfield) remap operation
On the normalization of camera rotation interpolation
Explanation of sensor flicker/banding phenomenon
Tips for using the potplayer video player
Unity implements smooth interpolation
Cross compile libev
MLP sensor
Summary of some problems in sensor bring up
zip 和.items()区别
C2w model - language model
JS预解析
leetcode 704. Binary search
Excel VBA opens a file that begins with the specified character
Redis configuration (IV) -- cluster
Redis data type (VII) -- hyperloglog
LeetCode-1405. Longest happy string
Redis application (I) -- distributed lock
Using hidden Markov model to mark part of speech