I have a strange issue:
My dropwizard API processes the uploaded file and saves it as a JPEG image
the uploaded file is read as an InputStream
.
FormDataBodyPart fileBody
is read using @FormDataParam("file")
InputStream imageStream = fileBody.getValueAs(InputStream.class);
final int maxSize = 102400;
final byte[] bytes = new byte[maxSize + 1];
int totalBytes = this.imageStream.read(bytes);
System.out.println("totalBytes:"+totalBytes);
the totalBytes
value returned is never greater than 8181
irrespective of the original size of the uploaded file. I tried with 800KB
and 1.3MB
files
the HttpServletRequest.getContentLength()
shows the correct number of bytes as uploaded
what am I missing here?