• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts 2 FileUpload Interceptor Problem for Large File Size Upload....

 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi,

I am trying to upload large size file from my struts 2 web application.
for upload larger file i have mentioned file size in the param to the fileUplod interceptor.

It works fine for file size up to 2 MB... but when i try to upload file of size say 30 MB then the property object value is null!

The action declaration in struts.xml file is as follow:



I am confused and didn't get any clue about the problem ?

Can you please help me in this regard ?

Thanks

Rahul
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Some servers set an upload limit, and the upload library itself might set a limit.
 
Rahul Nair
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

Thank you very much for replying!

According to my opinion.. i have not set any limit for file upload in server and etc.

But if this is case.. then How and where can i check/view that there is a limit set for File Upload ?

I am using Tomcat 6.0 and the Apache common-file upload and IO library...


Thanks

Rahul
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tomcat docs for the Tomcat question, I think there's a commons-fileupload properties file; don't recall off the top of my head though.
 
Rahul Nair
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

What is the default value for Tomcat Server Upload Limit and commons-file upload properties file upload limit ?

I did not got any properties file in commons-file upload jar file.
Also i have not put any separate properties file in my application for this purpose.

Sorry for some wrong thing i am asking, I am confused and did not get any clue about what you are saying here about file size.

Anyway, what is the other causes of above mentioned (previous post) Problem for larger file size except this reason ?

Also, in action declaration i have have provided the param with maximum Size for file Upload Interceptor, so i think it has to consider the provided param value for maximum file size. am i correct ?

Thanks

Rahul
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, there's a max size for the upload interceptor, but there is still the Tomcat upload size, and I'm pretty sure there's one for commons-upload--but I might be misremembering that.
 
Rahul Nair
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi,

Thank you very much for reply and give me the clue about the problem.

I have searched doc and also XMLs for File Upload Limit for Tomcat... but i did not get such information for File Size Upload.

Is it sure that the Struts 2 File Upload Interceptor does not upload Large Size file due to the only the limit mentioned in the Tomcat Server File Upoad Limit or
Commons file size upload limit ?

I tried a lot but i did not fine any such information in Tomcat Server nor common file upload jar file...

Now.. What i have do upload the large file using Struts 2 Framework ? Can you please guide me ?

Thanks

Rahul
 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can use these properties in your struts.xml within <struts>tag

<constant name="struts.multipart.maxSize" value="53477376" /> //give value as size in KB
 
Rahul Nair
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi lokesh,

Thank you very much for your answer! your answer is worthy for me.

It works and now the application can upload any size of file up to the limit that we have provided!

Anyway, But the value that we provide to struts.multipart.maxSize is in BYTES not in KB.

Thanks

Rahul



 
lokesh pattajoshi
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rahul,
you are welcome yaar.
 
Rahul Nair
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

The problem is solved now... But i have not understand one thing is that ....

How to configure the file upload interceptor using maximumSize parameter ?

Thanks

Rahul
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic