File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Struts 1 : Problem in uploading a file exceeding the configured max size limit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 1 : Problem in uploading a file exceeding the configured max size limit" Watch "Struts 1 : Problem in uploading a file exceeding the configured max size limit" New topic
Author

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

Khp Virajith
Ranch Hand

Joined: May 01, 2006
Posts: 85
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?


SCJP, SCWCD, SCMAD, SCSNI
Khp Virajith
Ranch Hand

Joined: May 01, 2006
Posts: 85
Hasn't anyone encountered this before?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts 1 : Problem in uploading a file exceeding the configured max size limit