I really can't understand the reason for this error. I ran the sample application. It works correctly. Same code but cannot load correctly. I think the error is due to the version difference. Anyone have any suggestions for a solution?
The web service I created
@POST
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(MediaType.APPLICATION_JSON)
public Response getImageText( @FormDataParam("file")InputStream inputStream) {
try {
byte[] bytes =IOUtils.toByteArray(inputStream);
inputStream.close();
System.out.println(bytes.length);
ArrayList<ImageBarcod> temp=null;
return Response.ok(temp).build();
} catch (Exception e) {
return Response
.status(Response.Status.NOT_FOUND)
.build();
}
}
bytes.length output:
file size to upload
upload file:
save file:
Libraries: