aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-web/src
diff options
context:
space:
mode:
authorrpiazzi <rpiazzi@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2011-10-25 10:19:37 +0000
committerrpiazzi <rpiazzi@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2011-10-25 10:19:37 +0000
commit3552a920be650a0145a6f3111f1fa76699cf88f3 (patch)
tree63a98b7048f8029effe858da3f36dc671eed179a /pdf-as-web/src
parent68320f87350df39dd48e8fe4cd3b60e699170599 (diff)
downloadpdf-as-3-3552a920be650a0145a6f3111f1fa76699cf88f3.tar.gz
pdf-as-3-3552a920be650a0145a6f3111f1fa76699cf88f3.tar.bz2
pdf-as-3-3552a920be650a0145a6f3111f1fa76699cf88f3.zip
Added filename of the original file within the header
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@878 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'pdf-as-web/src')
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ProvidePDFServlet.java4
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.");