A few comments:

1) The content you quote below does not match that in the RFC. The blank
lines are very important.
2) Your code shows some stuff that's commented out that would prevent the
upload from working if it was not commented out.
3) You don't show how you're creating and initialising the servletFileUpload
instance, so we can't tell if you got that right.

Martin Cooper

On 7/4/07, Ben Kuek <[EMAIL PROTECTED]> wrote:


I am using commons-fileupload-1.2

I am trying to upload a multipart/form-data from a client application
(written in C#)
to the servlet.

The servlet stops at:


returning an internal server error (500) to the client.
There are no error messages printed.
System.out.println(exception.getMessage()); doesn't seem to do anything


For testing, I made sure that the client sent the following string
(example from RFC 1867):

Content-type: multipart/form-data, boundary=AaB03x
content-disposition: form-data; name="field1"
Joe Blow
content-disposition: form-data; name="pics"; filename="file1.txt"
Content-Type: text/plain
... contents of file1.txt ...


In the servlet, I made sure that the string is received by printing the
request stream:

               //int intChar;
               //BufferedReader testBR = request.getReader();
               //while( (intChar = testBR.read())  != -1) {
               //    System.out.print((char)intChar);

               // I've confirmed that the string printed are as sent by
the client

               // Servlet will not move pass this line
               List items = servletFileUpload.parseRequest(request);


Am I doing something wrong?

Warmest regards,

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to