diff options
Diffstat (limited to 'pdf-as-web/src/main')
-rw-r--r-- | pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ProvidePDFServlet.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ProvidePDFServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ProvidePDFServlet.java index 741c8a6..dced4c9 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ProvidePDFServlet.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ProvidePDFServlet.java @@ -112,13 +112,15 @@ public class ProvidePDFServlet extends HttpServlet { SignServletHelper.disableBrowserCacheForResponse(response);
response.setContentType("application/pdf");
response.setContentLength(pdf.length);
+ SignSessionInformation si = (SignSessionInformation)session.getAttribute(SessionAttributes.ATTRIBUTE_SESSION_INFORMATION);
+ response.setHeader("Content-disposition", "attachment; filename=\""+si.filename+"\"");
InputStream is = new ByteArrayInputStream(pdf);
final int bufferSize = 1024;
byte[] buffer = new byte[bufferSize];
int len = -1;
while ((len = is.read(buffer)) != -1) {
- response.getOutputStream().write(buffer, 0, len);
+ response.getOutputStream().write(buffer, 0, len);
}
response.getOutputStream().flush();
log.debug("File sent. Invalidating session.");
|