Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Configure Max File Size for 1 Action  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have one struts 2.3 action which should be permitted to have very large file uploads and all of the other actions have a much smaller max file upload limit.

The first thing that I tried was adding the following to the action:



However, my 2 MB test file was still rejected as being too large (the large number as a parameter is 500 MB).

The next thing that I tried was defining a completely new interceptor-stack like this:



I then switched the action to use this interceptor-stack:



However, my 2 MB test file was still rejected for being too large. The rejection was by Struts - not tomcat or the web server. I get the following struts action error:

"Request exceeded allowed size limit! Max size allowed is: 2,097,152 but request was: 2,631,140!"

Does anyone see what I did wrong in the configuration? Or how I should configure struts to let one action upload large files?

Thanks!
 
Bartender
Posts: 9506
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The way I understand it, to set the maximum upload size and maximum file size for the entire application, one would declare (for a 1GB limit):



If you were going to configure the interceptor, the documentation says to do the following:


Note that the interceptor does not have properties named fileUpload.maximumSize (I've never seen that one) or struts.multipart.maximumSize (which is a Struts property, not an interceptor property)
I don't know for certain that doing both would allow the action to override the global setting, but the documentation seems to say that it can.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!