Details
-
Bug
-
Resolution: Duplicate
-
Major
-
None
-
2.1.0.GA
-
None
-
None
Description
Hi,
I'm trying to process a file upload with the multipart/form-data
facility like this:
@POST @Path("/upload") @Consumes(MediaType.MULTIPART_FORM_DATA) public Object upload(MultipartFormDataInput formData) throws IOException { InputPart part = formData.getFormDataMap().get("file").get(0); // "file" is the name of the browser's input field DataSource dataSource = part.getBody(new GenericType<DataSource>() { }); InputStream in = dataSource.getInputStream(); // ... read from input stream return Response.ok().build(); }
The data source has the correct content type, so the setup seems to be
generally right.
But when I read from the input stream, I get only 1024 bytes even if
the uploaded file is longer.