Good Morning Jason,

thanks a lot. I will check the code.

Regards 

Michael






Von:    Jason Britton <[email protected]>
An:     Commons Users List <[email protected]>
Datum:  15.10.2010 15:17
Betreff:        Re: Commons Upload: Can not read parameters if input type 
file is empty ...



Before you call parseRequest I would first check to make sure you're
dealing with a multipart post - in cases when you're not uploading a
file calling parseRequest may not be the right way to go and that
exception being thrown is FileUpload's way of telling you, hey I don't
see any file data to handle thus the  "Stream ended unexpectedly".
That's my best guess.  Try something like this

// Check that we have a file upload request
boolean isMultipart = ServletFileUpload.isMultipartContent(request);

if (isMultipart) {
    // do your parseRequest here since you know they uploaded a file
} else {
    // no file uploaded this time, try retrieving non-file form
parameter values old fashioned way, request.getParameter("foo") etc...
}

// operate on retrieved form data here

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]





====================================================
HIL Heeresinstandsetzungslogistik GmbH
Sitz Bonn
Amtsgericht-Registergericht-Bonn - HRB 13651
Geschäftsführer: Ulrich Frieling (Sprecher), Günter Schwarz
Aufsichtsratsvorsitzender: Willi Walgenbach

Reply via email to