• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Struts 1 : Problem in uploading a file exceeding the configured max size limit

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

I have encountered an unusual behaviour with respect to file upload capability in Struts 1 application.

I have configured the max upload file size limit using the <controller> tag in struts configuration file as follows.

<controller maxFileSize="500K" />

Struts uses common fileupload library to handle file uploading functionality by default and if the file being uploaded exceeds the max file size, it sets a request-scopedattribute in the type of Boolean, under the name of the constant value : MultipartRequestHandler.ATTRIBUTE_MAX_LENGTH_EXCEEDED.

But I experienced an unusual behaviour with large file upload. When uploading a larger file which is 300MB in size, my page hangs as the browser keeps sending the request data (obviously the file data stream) . But from server side, as soon as it determines that the file size is greater than the size limit, it immediately sets the earlier mentioned request-scoped variable and jumps out of the Action layer. So I feel that the request processing is not hung at server side, but browser keeps sending file data to the server even though the server has finished processing the request. Is there any solution for that? Am I missing something?

I'm using Struts 1.2.7 and commons file upload 1.0 combination. Also I re-tested the same functionality in latest Struts version that is 1.3.10 with common file uploads 1.2, but the behaviour is same.

Does anyone have any idea on solving this?
 
Khp Virajith
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hasn't anyone encountered this before?
 
I don't get it. A whale wearing overalls? How does that even work? It's like a tiny ad wearing overalls.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic