Jason,

Sure, lucky to be able to keep IE5 out while the rest of us must suffer ;-)

Well, the file upload worked just fine on your site.

That's not really surprising, since the errors we were seeing did not even
include a file to be uploaded (the uploaded file is optional on our form),
but about 7 form fields and one bigger TEXTAREA input form.  The total
uploaded data was only about 6k.

I was able to work around the problem just by not throwing that exception.
Instead, I just output an error and then continue on, and things seem to
work okay even when the error message is produced.  It's definitely hit or
miss, since I can use the form several times under IE5 without any problem,
and then it occurs.  I have a hunch it's somehow related to new
sessions/cookies, but only because it seems to occur more when a fresh
session is created than not, yet it doesn't always seem to be for that
reason. (I'm using an older JRun running the 0.92 JSP spec until I can get
enough breathing room to move forward).

The code change I made was as follows in readRequest()

    // Verify that the line is the boundary
    if (!line.startsWith(boundary)) {
      // throw new IOException("Corrupt form data: no leading boundary");
      System.err.println("Corrupt form data: unexpected leading boundary --
trying to continue??");
      System.err.println("Corrupt form data: boundary   = " + boundary);
      System.err.println("Corrupt form data: first line = " + line);
    }


I had no idea what would happen, but it seemed to work.  However, I don't
know if it will really work even if there is a file to be uploaded too.  The
boundary and line have different numbers to define their parts.

David


----- Original Message -----
From: "Jason Hunter" <[EMAIL PROTECTED]>
To: "David Wall" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, December 06, 1999 5:55 PM
Subject: Re: Jason Hunter's File upload servlet


> David Wall wrote:
> >
> > Has anybody seen this recent problem (I've only seen it with IE5 so
> > far) that appears with Jason Hunter's file upload servlet (actually
> > com.oreilly.servlet.MultipartRequest):
> >
> > The servlet throws: Corrupt form data: no leading boundary
> >
> > So, I put in a trace, and I sometimes have no problem with the upload
> > and the first line matches the boundary. But in the exception
> > condition, they are not quite the same...
> >
> > DEBUG: boundary: -----------------------------7cf2bca2f8
> > DEBUG: length: 6552
> > Read first line: -----------------------------7cf280a2f8
> >
> > Is this a new bug with IE5 under some unknown circumstances?  After
> > all, I can repost the form and it will work just fine.  There's
> > something odd since I had not seen it before for several months of
> > using the Hunter class.
>
> Yes, I've started to get reports on this now and then, only from people
> using IE5.  So if you're using IE5, please do a test upload to
> http://www.servlets.com/book/examples/ch04/upload.html (50K max)
> and email me privately with your "yea" or "nay" success results.
> Explanations and solutions you come up with by looking at the
> MultipartRequest code are welcome too.  :-)  (I don't have IE5
> installed anywhere, and would like to keep it that way.)
>
> -jh-
>
> --
> Jason Hunter
> [EMAIL PROTECTED]
> Book:    http://www.servlets.com/book
> 2.0 to 2.1: http://www.javaworld.com/jw-12-1998/jw-12-servletapi.html
> 2.1 to 2.2: http://www.javaworld.com/jw-10-1999/jw-10-servletapi.html
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to