On 21 March 2011 20:51, Travis Shepherd <[email protected]> wrote: > Resending as I was not subscribed initially - forgive me if this is a > duplicate message. > > I'm using commons fileupload to parse a multipart upload request generated by > a third party. Their header for a file post looks like this (from TCP trace): > > ------------------------------8cdb60c121688fc > Content-Disposition: form-data; name="ScanData000"; filename="abc.tif" > Content-Type: image/tiff > > (note the leading space on the Content-Type line). When parsing this request > with fileupload, I end up with a FileItem object with the following > properties: > FieldName: ScanData000 > Content Type: null > Name: "abc.tif" Content-Type: image/tiff > Value: <binary image content> > > Note that the value of FileItem.getName()contains literal quotation marks as > well as the text "Content-Type: image/tiff" > > Is this a bug in the parser, or is the generated HTTP post invalid (and if > invalid, based on what RFC etc?). If it is invalid, I can try to go back to > the third party and ask for a fix.
Bug in the 3rd party product: http://tools.ietf.org/html/rfc822#section-3.4.2 Leading space means it is a continuation line, so FileUpload is behaving properly. > -Travis > > > Travis Shepherd > Project Lead, SW Engineer > Kofax, Inc. > > 15211 Laguna Canyon Road > Irvine, CA 92618 > United States > > Tel: +1 (949) 783-1209 > Fax: +1 (949) 727-3144 > [email protected] > > > ________________________________ > > This communication is only for the use of the intended recipient. It may > contain confidential or proprietary information. If you are not the intended > recipient or have received this communication in error, please notify the > sender via phone and destroy this communication immediately. > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
