FileUploadBase$SizeLimitExceededException apache tomcat

后端 未结 4 1808
不知归路
不知归路 2021-02-04 04:36

Im trying to upload file from a JSP file and I get the following error in catalina.out. As specified in many blogs, I increased the the max-file-size under webapps/manager/WEB-

4条回答
  •  旧巷少年郎
    2021-02-04 05:21

    you can use in Servlet like bellow

        @WebServlet(name = "RemittanceDocApi", urlPatterns = {"/RemittanceDocApi"})
        @MultipartConfig(fileSizeThreshold = 1024 * 1024 * 2, // 2MB
        maxFileSize = 1024 * 1024 * 10, // 10MB
        maxRequestSize = 1024 * 1024 * 50)   // 50MB
        public class RemittanceDocApi extends HttpServlet {
    
        }
    

提交回复
热议问题