Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • 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:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

ControllerConfig - MaxFileSize

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Need some help. Thanks in advance.


I have file upload application in struts. I have customized MultipartRequestHandler and in my customized MultipartRequestHandler class, i am printing the maximum file size to process for file uploads. It is printing as 250M but I am not sure where it is getting this value from. In my case i wanted to restrict to 50M. Pls help. Thanks again.

Ven
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know which implementation you are using, but for example the CommonsMultipartRequestHandler set its default max size to 250M. How did you customize your MultipartRequestHandler ?
 
Venkat Babu
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
public class CustomMultiPartRequestHandler implements MultipartRequestHandler {
.
.
.
public void handleRequest(HttpServletRequest request)
throws ServletException {
ModuleConfig ac = (ModuleConfig) request.getAttribute(Globals.MODULE_KEY);
mc.getControllerConfig().getMaxFileSize() //prints 250M
.
.
}

And in struts-config.xml :

<controller multipartClass="pack.CustomMultiPartRequestHandler" />

Pls let me know if I have not answered your question.

I trying to implement fileupload app using struts/ajax/dwr. I want to set the Maxfile upload to 50M.
[ May 02, 2008: Message edited by: Venkat Babu ]
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The controller element has a maxFileSize attribute which you should use in this case. Example:
 
Venkat Babu
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot.
 
You got style baby! More than this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic