• 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
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

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.
 
Farmers know to never drive a tractor near a honey locust tree. But a tiny ad is okay:
Enterprise-grade Excel API for Java
https://products.aspose.com/cells/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!