This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts2 File Upload Maximum Size Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "Struts2 File Upload Maximum Size" Watch "Struts2 File Upload Maximum Size" New topic
Author

Struts2 File Upload Maximum Size

monica jindal
Greenhorn

Joined: May 01, 2009
Posts: 5

Hi All,

I am new to the struts2 framework.And first time doing file upload using struts2 framework.My requirement is to upload the number of files with no limit on file size.
When I am trying to add a file more then 10 MB it is giving me the exception
as
org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (15379388)
exceeds the configured maximum (10485760).

I also tried to configure with interceptor

<action name="addFilePath" class="com.kjaya.ris.servlet.ULinkFilesServlet" method="addFiles">
<interceptor-ref name="fileUpload">
<param name="maximumSize">500000</param>
</interceptor-ref>

then I got a error message on my jsp page as
the request was rejected because its size (15379388) exceeds the configured maximum (10485760)

Can anyone please help me to solve this problem

Thanks in advance
Monica Jindal
Rajkumar balakrishnan
Ranch Hand

Joined: May 29, 2008
Posts: 445

Try increase the file size(from 500000 to much greater) and post back if you get any error.


Never try to be a hard-worker. Be a smart-worker.
My Blog
monica jindal
Greenhorn

Joined: May 01, 2009
Posts: 5
Hi,

Sorry for the delay for replying .
I got the solution of the problem.
I increased the size as struts.multipart.maxSize=100485760 in struts.properties file
By doing this file size limit is extended but at the same time I cannot have unlimited file size because
struts2 framework would not allow as it affects the performance .




Thanks
Monica
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Struts2 File Upload Maximum Size
 
Similar Threads
struts2 + interceptor
Struts2 file upload resets form if maxsize exceeds
Struts2 FileUpload - request is nulled
File Uploaod Size Limit exceeded exception
Struts2: file upload not working