You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Shahak Nagiel <sh...@jillandshahak.com> on 2004/05/13 03:25:54 UTC

FileUpload: parseRequest not returning anything

I have a JSP form with multiple standard (text & select) fields, and one
file field.  To confirm, the only relevant and required portions of the page
are:

<form name="foo" method="post" action="bar.do"
enctype="multipart/form-data">
...
<input type="file" size="50" name="file">

When submitted (with all the fields' values populated),
FileUpload.isMultipartContent(request) returns true, but
upload.parseRequest(request) returns an empty List.  Any ideas why?

(By the way, this is being implemented in a Struts action class, but the JSP
is not tied to a Struts form--long story--hence I'm not using the Struts
html:file tag.  I didn't think that should cause any issues, but in the
interests of disclosure, there it is.)

Thanks,
Shahak


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


Re: FileUpload: parseRequest not returning anything

Posted by Michael Katz <ec...@yahoo.com>.
Previously someone's problem was that something had already consumed the 
request... therefore there was nothing left to parse when they tried to 
do a parseRequest...

Shahak Nagiel wrote:
> I have a JSP form with multiple standard (text & select) fields, and one
> file field.  To confirm, the only relevant and required portions of the page
> are:
> 
> <form name="foo" method="post" action="bar.do"
> enctype="multipart/form-data">
> ...
> <input type="file" size="50" name="file">
> 
> When submitted (with all the fields' values populated),
> FileUpload.isMultipartContent(request) returns true, but
> upload.parseRequest(request) returns an empty List.  Any ideas why?
> 
> (By the way, this is being implemented in a Struts action class, but the JSP
> is not tied to a Struts form--long story--hence I'm not using the Struts
> html:file tag.  I didn't think that should cause any issues, but in the
> interests of disclosure, there it is.)
> 
> Thanks,
> Shahak


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


Re: FileUpload: parseRequest not returning anything

Posted by Martin Cooper <ma...@apache.org>.
"Shahak Nagiel" <sh...@jillandshahak.com> wrote in message
news:EDEHLIAMLDIDCMPJOIPDKEAICAAA.shahak@jillandshahak.com...
> I have a JSP form with multiple standard (text & select) fields, and one
> file field.  To confirm, the only relevant and required portions of the
page
> are:
>
> <form name="foo" method="post" action="bar.do"
> enctype="multipart/form-data">
> ...
> <input type="file" size="50" name="file">
>
> When submitted (with all the fields' values populated),
> FileUpload.isMultipartContent(request) returns true, but
> upload.parseRequest(request) returns an empty List.  Any ideas why?
>
> (By the way, this is being implemented in a Struts action class, but the
JSP
> is not tied to a Struts form--long story--hence I'm not using the Struts
> html:file tag.  I didn't think that should cause any issues, but in the
> interests of disclosure, there it is.)

You say that the JSP is "not tied to a Struts form", but do you have a form
bean specified for the action mapping to which the request is being
submitted? If so, then Struts will parse the request and consume the input
stream before your action is ever invoked.

--
Martin Cooper


>
> Thanks,
> Shahak




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