0

I am trying to upload a file through my JAVA Struts 1.1 Application. Using the Tomcat Server. The problem I was facing was : file size was greater than the default size of the Tomcat allowed size. So we need to change the "maxPostSize" parameter of server.xml

After changing the maxPostSize and the connectionTimeout in Server.xml, the issue is resolved. However what if we do not have the permission to make changes to server.xml

Is there a way around for this through Java code. Any way by which we can overwrite the "maxPostSize" parameter of server.xml any way I can cofigure my application to ignore the Tomcat Size and take the specified size limit.

Please Help!

Rahul_Java
  • 13
  • 1
  • 7

1 Answers1

0

Please check your controller (in struts-config) has something like this (I think it's optional actually),

<controller
maxFileSize="300K" />

change size and check whether it is working or not.

  • This does not work. No Help after adding this part to my struts-config – Rahul_Java Feb 25 '13 at 07:23
  • org.apache.commons.fileupload.FileUploadException: Processing of multipart/form-data request failed. Read timed out at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:429) at org.apache.struts.upload.CommonsMultipartRequestHandler.handleRequest(CommonsMultipartRequestHandler.java:195) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:445) at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:798) Error LOg – Rahul_Java Apr 10 '13 at 06:51