Issue
I have a Java webapp creating a pdf and streaming 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 it is sent back to the browser, but I can not control the name of the file even though I set the content-disposition
.
I am using Jboss 4.2.1. Do you know what am I missing?
EDIT: So is there any way to set the filename when the content-disposition is inline?
Solution
content-disposition: attachment ....
Answered By - Spliffster