You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Rahulkumar_Srivastava <Ra...@Satyam.com> on 2003/04/25 16:11:04 UTC

RE: DO NOT REPLY [Bug 19045] - uploading file exceeding max fil e size resets IE connection

I faced another proble in file upload any clue..?

When ever a  multipart  request (the form contain following tag
enctype="multipart/form-data" ) is processed by struts ,it wraps the
original request in a MultipartRequestWrapper class (Pl. see the method
processMultipart()). 
When this action forwards this request to some other action class , it can
be forwarded  by either of the two ways..
    1.Using Response.sendRedirect()
    2.RequestDispatcher.forward()
 
The first case is  simple, since each time a new request goes from browser,
hence original request is not required.
So if we make redirect="true" in the forward tag of struts-config.xml  there
won't be any problem.But in PC application we can't
do that since it has to keep the information of original request.
 
But the later case is different , because  this needs to carry the original
request.Since original request is wrapped 
in to a MultipartRequestWrapper  class hence , we need to unwrap the
original request from the wrapper class
before forwarding it to some other action class .The doForward() method of
Requestproceesor.java file was not
doing that, hence it was resulting in a ClassCastException i.e.. the code
was expecting request while it was getting MultipartRequestWrapper .
The file upload  example shipped with the struts framework also does not
work because of the reason and i found in Internet 
that many people were complaining about the same problem.Hence I added
following piece  of code to make it work, 
 
if (request instanceof MultipartRequestWrapper) {
         request = ((MultipartRequestWrapper) request).getRequest();
       //Extracting the original request from wrapper before forwarding it.
}
I feel  that this piece of code is really required before forwarding it, and
it should  not effect any functionality. 
Any thoughts..

Regds,
Rahul

-----Original Message-----
From: bugzilla@apache.org [mailto:bugzilla@apache.org]
Sent: Friday, April 25, 2003 7:26 PM
To: struts-dev@jakarta.apache.org
Subject: DO NOT REPLY [Bug 19045] - uploading file exceeding max file
size resets IE connection


DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19045>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19045

uploading file exceeding max file size resets IE connection

dgraham@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID



------- Additional Comments From dgraham@apache.org  2003-04-25 13:55
-------
This seems like a browser specific problem.  If IE is ignoring commands from
the 
server, we can't do much about it.

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org
************************************************************************** 
This email (including any attachments) is intended for the sole use of the
intended recipient/s and may contain material that is CONFIDENTIAL AND
PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or
distribution or forwarding of any or all of the contents in this message is
STRICTLY PROHIBITED. If you are not the intended recipient, please contact
the sender by email and delete all copies; your cooperation in this regard
is appreciated.
**************************************************************************

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org