This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ControllerConfig - MaxFileSize

 
Venkat Babu
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
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 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 ]
 
Merrill Higginson
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic