Set filename of the Pdf that is streamed back to the browser
问题 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