On 9/23/05, Lutz Horn <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I've got a problem using FileUpload 1.0 with Spring 1.2.1 inside Tomcat
> 5.0.28. I use to following form to upload a file to a web application
> (client is Firefox 1.5b1).
>
> <form action="upload.htm" method="post"
> enctype="multipart/form-data">
> <input type="file" name="file"/>
> <input type="hidden" name="id" value="<c:out 
> value="${object.id<http://object.id>
> }"/>"/>
> <input type="submit"/>
> </form>
>
> Inside the web application the following Spring controller handles the
> request.
>
> public class UploadController extends AbstractController {
>
> protected ModelAndView handleRequestInternal(HttpServletRequest req,
> HttpServletResponse res) throws Exception {
>
> boolean isMultipart = FileUpload.isMultipartContent(request)
> DiskFileUpload upload = new DiskFileUpload();
>
> List items = upload.parseRequest(req);
> Integer filecount new Integer(items.size());
> }
> }
>
> Request type and encoding are correct, isMultipart is true. But the List
> returned by DiskFileUpload.parseRequest(req) is empty.
>
> Any ideas where to look?


I'm not familiar with Spring MVC, which is what I assume you are using.
However, the most likely cause of the problem you are seeing is that Spring
has already parsed the upload request for you, and so the input stream has
been consumed and is no longer available for (re)parsing by Commons
FileUpload.

--
Martin Cooper


Regards
> Lutz
> --
> email service provided by
> http://www.fastmail.fm/mail/?STKI=600622
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to