Struts FileUpload - Multipart data doesn't start with boundary
posted 13 years ago
I am using Struts 1.1 FileUpload to upload an image file. I specify enctype for the form as "multipart/form-data". The file item in the ActionForm is of type org.apache.struts.upload.FormFile. The form submits successfully. The FileUpload.isMultipartContent(request) flag returns true. I proceed to handle the request, using the Struts MultipartIterator like so: MultipartIterator iterator = new MultipartIterator(request, bufferLength, contentLength); A IOException is thrown : Multipart data doesn't start with boundary I understand that in order to read the request it must find the boundary and looking at the way the MultipartIterator is implemented, it appears that it parses the content type string until it finds "boundary". When I write out the content-type, I get the following: multipart/form-data; boundary=---------------------------7d33d7c37019a So the content-type appears to contain a boundary. Has anyone encountered this problem before or have any suggestions?