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 <[EMAIL PROTECTED]> 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

Reply via email to