You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Sayles, Scott SAXONHQ" <Sa...@Saxonmtg.com> on 2000/11/16 21:16:22 UTC

multipart requests

Michael,
Ya, I've checked it out.  It's nice that it's built in.  Although, I was
having problems with uploading relatively larger files (like 300k!).  For
some reason, the getNextElement() method for MultipartIterator was taking
way too long.  I tried setting the buffer sizes to various sizes with no
significant changes.  I probably missed something about how to utilize these
components.  Since I wasn't using implementing an action form for the form,
the DiskMultipartRequestHandler(DMRH) never came into play from the form
processing.  I explicity utilized the handler in the action class and set
the buffer sizes for both the iterator and the handler from 1 - 10Mb.  The
reason I did this was so that I could explicitly specify different
directories to write the file to based on the request (as opposed to the one
defined in the servlet init-param).  I ended up using the MultipartRequest
stuff from Oreilly and it works fine.  I know I could have done it
differently, but any thoughts on what problems there might have been?

Thanks

Scott
-----Original Message-----
From: Schachter, Michael [mailto:MSchachter@Bluestone.com]
Sent: Thursday, November 16, 2000 2:58 PM
To: 'Sayles, Scott SAXONHQ '
Subject: RE: multipart requests / request attributes and forwarding


 Scott,

Although this isn't an answer to your question, have you checked out the
multipart request handling that's built into struts now?  All you have to do
is create set and get methods of type "FormFile" in your ActionForm class
and the proper form:file tags in your jsp for file uploading.

-----Original Message-----
From: Sayles, Scott SAXONHQ
To: 'struts-user@jakarta.apache.org'
Sent: 11/16/00 2:33 PM
Subject: multipart requests / request attributes and forwarding

Hello,

I'm facing a small dilema.  I've created a struts action class that
handles
requests for uploading files.  I'm creating some action errors using the
standard struts method in which the action errors are added to an action
errors object and is forwarded to a page that is using the
<struts:errors/>
tag.  When the request is forwarded to the page, the tag (I assume) is
not
able to handle the request attribute to get the errors.  It seems like
the
request attributes are not excluded from the multipart request format.
I'm
getting a "page cannot be displayed" meesage from the browser.  When I
take
out the tag, the page comes up fine.  I could probably just make a
single
specific error page or put the errors into the session scope, but
perhaps
there's a more elegant solution to handle this?  Perhaps, I'm missing
something?  Any thoughts?

Thanks

Scott