当前位置:网站首页>上传文件(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”
解决:桌面存在同名文件?换个文件夹放,重选文件,就正常了。
边栏推荐
- JS变量作用域
- Analysis of memory management mechanism of (UE4 4.26) UE4 uobject
- Multithreading (V) -- concurrency tools (I) -- thread pool (II) -- related contents of ThreadPoolExecutor
- Computer composition and design work06 —— 基于MIPS
- PHP 读写 COOKIE
- 分段贝塞尔曲线
- UE4 4.27 modify the mobile forward pipeline to support cluster multi light source culling
- JS variable scope
- Remap function of C different interval mapping
- Dlib face detection
猜你喜欢

Multithreading mode (I) -- protective pause and join source code

Summary of some problems in sensor bring up

SQL 注入-盲注

(UE4 4.27) customize globalshader

关于 Sensor flicker/banding现象的解释

Overview of camera image quality

使用 ms17-010 永恒之蓝漏洞对 win7 进行渗透及建立永久后门

Dlib face detection

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

In unity3d, billboard effect can be realized towards another target
随机推荐
LeetCode-1445. Apples and oranges
Word2Vec
MNIST handwritten data recognition by RNN
leetcode 35. Search insert location
Sensor bringup 中的一些问题总结
JS variable scope
MLP sensor
PDF. JS help file
Zip and Items() difference
leetcode 300. Longest increasing subsequence
RMB classification II
torch在高版本训练的模型在低版本中使用报错
Video fire detection based on Gaussian mixture model and multi-color
Unity3d multi platform method for reading text files in streamingasset directory
Word vector training based on nnlm
摄像头拍摄运动物体,产生运动模糊/拖影的原因分析
Multithreading (IV) -- no lock (IV) -- unsafe
What states do threads have?
Apache poi 导入导出Excel文件
C # converts the hexadecimal code form of text to text (ASCII)