的分段文件上传失败

的分段文件上传失败

本文介绍了使用带有 tomcat 版本 9.0.31 的 spring boot 的分段文件上传失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

spring boot 应用程序中的多部分文件上传不适用于 tomcat 9.0.31 版.但是这个功能在旧版本 9.0.30 上工作正常.但是这个版本有一个漏洞,被迫升级版本.请参阅下面给出的错误

Multi part file upload in spring boot application is not working with tomcat version 9.0.31. But this functionality working fine with older version 9.0.30 .But there is a vulnerability in this version and forced to upgrade the version.See the error given below

 "timestamp": "2020-03-09T08:01:56.169+0000",
"status": 500,
"error": "Internal Server Error",
"message": "Failed to parse multipart servlet request; nested exception is java.io.IOException: org.apache.tomcat.util.http.fileupload.impl.IOFileUploadException: Processing of multipart/form-data request failed. Stream ended unexpectedly",

错误日志如下

nested exception is org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request; nested exception is java.io.IOException: org.apache.tomcat.util.http.fileupload.impl.IOFileUploadException: Processing of multipart/form-data request failed. Stream ended unexpectedly] with root causeorg.apache.tomcat.util.http.fileupload.MultipartStream$MalformedStreamException: Stream ended unexpectedly

请帮助解决此问题.

推荐答案

我认为最新的 tomcat 版本 9.0.33 已修复该错误.

I think the bug has been fixed with latest tomcat version 9.0.33.

在版本 9.0.31 中无法使用的多部分文件上传功能也已通过升级修复.另外,我尝试使用owasp依赖项检查器检查是否存在任何漏洞,发现此版本中没有漏洞.

The multi-part file upload functionality which was not working in version 9.0.31, has also been fixed with the upgrade. Also, I have tried checking if there are any vulnerability using owasp dependency checker and found that there are no vulnerabilities in this version.

只需使用以下版本升级您的依赖项:

<!-- https://mvnrepository.com/artifact/org.apache.tomcat.embed/tomcat-embed-core -->
<dependency>
    <groupId>org.apache.tomcat.embed</groupId>
    <artifactId>tomcat-embed-core</artifactId>
    <version>9.0.33</version>
</dependency>

这篇关于使用带有 tomcat 版本 9.0.31 的 spring boot 的分段文件上传失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 05:22