commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chief Tool <chief_t...@yahoo.ca>
Subject Re: [fileupload] Netscape/Firefox stream ended unexpectedly
Date Fri, 03 Sep 2004 14:48:05 GMT
Ok here is my next test.  Instead of doing the javascript submit, i've added a submit button
to the form and the data is upload just fine.  However this is not the desired process.  Sounds
like a Netscape/FireFox/Mozilla DOM issue.
 
Thoughts?
 
CT

Chief Tool <chief_tool@yahoo.ca> wrote:
So I'm still having problems uploading larger files. I have set the following up: 


static public final long SIZE_MAX = 40000000;
static public final int SIZE_THRESHHOLD = 65536;

DiskFileUpload upload = new DiskFileUpload();
upload.setHeaderEncoding("UTF-8");
upload.setSizeMax(SIZE_MAX);
upload.setSizeThreshold(SIZE_THRESHHOLD);

List items = upload.parseRequest(request, SIZE_THRESHHOLD, SIZE_MAX, System.getProperty("java.io.tmpdir"));



When the parseRequest begins it throws the exception that the stream ended unexpectedly. 

Has anyone tried this combination of submitting the form via JavaScript, with Netscape/Firefox/Mozilla?

Hope someone has had success with this combination and provide some guidance.

Thanks
CT


Martin Cooper wrote:
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 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 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




---------------------------------
Post your free ad now! Yahoo! Canada Personals



---------------------------------
Post your free ad now! Yahoo! Canada Personals

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message