commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Cooper <mfncoo...@gmail.com>
Subject [fileupload] Re: Netscape/Firefox stream ended unexpectedly
Date Thu, 02 Sep 2004 18:22:40 GMT
First of all, please prepend the name of the Commons component to the
message subject, so people know which component you're asking about...

If the problem lies with large uploads, you may need to increase the
maximum request size that FileUpload will accept before bailing out.

--
Martin Cooper


On Thu, 2 Sep 2004 13:49:39 -0400 (EDT), Chief Tool <chief_tool@yahoo.ca> wrote:
> After some more testing, it looks like things are working.  The issue is that with larger
files it doesn't have the full posted data therefore it dies.  I'll have to figure out another
way of reading it all then parsing.  I tested it with a 1k file and it worked.
> 
> CT
> 
> 
> 
> Chief Tool <chief_tool@yahoo.ca> wrote:
> So here is my situation. I have a HTML form that gets its fields added via DHTML. There
is no submit button on this form but rather I call _javascript that does the from submit.
> 
> My form is doing a "POST" to a servlet which has the following code to parse the multipart/form-data.
> 
> DiskFileUpload upload = new DiskFileUpload();
> ...
> List item = upload.parseRequest(request);
> 
> I end up getting an exception of "Stream ended unexpectedly" tossed from MultipartStream.java.
By the looks of things in MultipartStream.java.
> 
> 9/2/04 12:39:33:919 EDT] 57b4a1e1 SystemErr R org.apache.commons.fileupload.FileUploadException:
Processing of multipart/form-data request failed. Stream ended unexpectedly
> 
> bytesRead = input.read(buffer, pad, bufSize - pad);
> 
> ends up returning -1.
> 
> So I'm really confused, here is what I've tried. Walking through the code the form fields
are parsed just fine when the _javascript submits the form data. However adding a file we
get this issue of "Stream ended unexpectedly", as expected by adding an attachment. I've added
an "input" field submit button, then pressing the button to do the POST everything works.
However I can't use this behaviour, the submit must be executed via _javascript, without user
interaction.
> 
> So this behavior works fine in IE 6.0+ but Netscape, FireFox, Mozilla all fail. They
all end up having the exception tossed.
> 
> I wonder if anyone else has come across this issue of having the data submit via _javascript.
> 
> This behavior exists with the following application servers:
> * Websphere 5.1
> * JBoss 3.2.3
> 
> ---------------------------------
> Post your free ad now! Yahoo! Canada Personals
> 
> ---------------------------------
> Post your free ad now! Yahoo! Canada Personals
>

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


Mime
View raw message