欢迎使用普元产品知识库,本知识库包含普元应用开发平台EOSPlatform,流程平台BPS,企业服务总线ESB,微服务平台Microservice,运维管理平台Devops,数据集成平台DI
欢迎使用普元文档库
解决方案:
在apps_config\default\config\user-config.xml中修改上传文件大小(红色字体)
<group name="FileUpload">
<configValue key="TempDir">upload</configValue>
<configValue key="MaxSize">104857600</configValue>
<configValue key="InMemorySize">10240</configValue>
<!--files with specified ext names are not accespted when uploading -->
<configValue key="Exclude">exe,java,jsp,html,htm,class,jar</configValue>
</group>
例如:
1、基于EOS Platform7.5 产品中apache附件上传jar包,实现附件上传功能,执行List<FileItem> list = diskFileUpload.parseRequest(request);时报错:
org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (1625721886) exceeds the configured maximum (1073741824)
at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:310)
at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:268)
at org.apache.jsp.mfg.MobileDataUpload_jsp._jspService(MobileDataUpload_jsp.java:139)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
页面上传关键代码:
<%
String dataID = "";
String activityDefID = "";
File file = null;
String fileData = "";
String basePath = "d:/mobile_uploadfiles/";
String catalog_key = "yyyyMM";
String file_key = "yyyyMMddHHmmssSSS";
String catalog = "";
String fileSaveName = ""; //文件保存名称
String filePath = ""; //文件保存路径
String fileName = ""; //文件名称
String fileExt = ""; //文件后缀
long fileSize = -1; //文件大小
try{
DiskFileUpload diskFileUpload = new DiskFileUpload();
diskFileUpload.setHeaderEncoding("GBK");
diskFileUpload.setSizeMax(5*1024*1024*1024);
//下面一句报错。。。。
List<FileItem> list = diskFileUpload.parseRequest(request);//该句报错。
....
客户项目级解决方案,供参考:
定位到附件上传的依赖的jar包限制了int类型为2g,导致了上述错误,项目中将Platform7.5里的commons-fileupload、commons-httpclient、commons-io、commons-lang的jar包升级成了如下版本后,没再出现上述问题,升级后的jar包:附件上传相关jar包.zip
,