I have a Java webapp that creates a pdf file and transfers it back to the browser.
byte[] pdf = report.exportPdfToArray(user);
response.setContentType("application/pdf");
response.setHeader("content-disposition", "inline; filename=\"My.pdf\"");
outStream = response.getOutputStream();
outStream.write(pdf);
outStream.flush();
outStream.close();
The report is executed and sent back to the browser, but I can not manage the file name, even if I installed it content-disposition. I am using Jboss 4.2.1. Do you know what I am missing?
EDIT : so is there a way to set the file name when the content is in a line?
source
share