I'm running in to an issue when trying to upload a file to a spring/jackson webservice. My service description is below:
@POST
@Path("/foo/{someID}")
@Consumes(MediaType.MULTIPART_FORM_DATA)
public Response uploadFile(
@FormDataParam("file") InputStream uploadedInputStream,
@FormDataParam("file") com.sun.jersey.core.header.FormDataContentDisposition fileDetail,
@PathParam("someID") Long supplierID)
{
}
The error I'm getting is:
The request sent by the client was syntactically incorrect.
Here are my headers pulled from Chrome for one that isn't working.
Accept:*/*
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Content-Length:879585
Content-Type:multipart/form-data; boundary=----WebKitFormBoundary1VA1IfWOdVmZqk49
Cookie:SPRING_SECURITY_REMEMBER_ME_COOKIE=COOKIE_HERE
Host:localhost:8081
Origin:chrome-extension://hgmloofddffdnphfgcellkdfbfbjeloo
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31
Request Payload
------WebKitFormBoundary1VA1IfWOdVmZqk49
Content-Disposition: form-data; name="file"; filename="Chrysanthemum.jpg"
Content-Type: image/jpeg
------WebKitFormBoundary1VA1IfWOdVmZqk49--
Found out that it's not the content type, but the content size. At 9377 bytes it breaks, but at 9375 bytes it works. Unfortunately that doesn't seem to coincide with any documented limit (default or otherwise) in Tomcat, Spring, or Jersey, so I'm stuck as to what would be causing this.