I'm trying to get a download to open from a call to another function that returns it as a ResponseEntity Byte. The problem is that when it returns it isn't downloading in the browser. A download box will open when I query the function I'm calling directly.
byte[] content = ...//gets the content
HttpHeaders header = new HttpHeaders();
header.setContentType(MediaType.parseMediaType("application/pdf"));
return new ResponseEntity<byte[]>(contents, header, HttpStatus.OK);
why isn't a download box coming up in the browser when I call this from the javascript? am I missing something?