[Dive4elements-commits] [PATCH] Explicitly set the content type for the pdf download

Wald Commits scm-commit at wald.intevation.org
Tue Apr 9 11:54:11 CEST 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1365501227 -7200
# Node ID 6e0d122904f91addbb1322f5c9c5ef836872b692
# Parent  0d8564196d73780553d8e6af40a509d1139bf6f8
Explicitly set the content type for the pdf download.

    This should make the mimetype detection of browsers more robust

diff -r 0d8564196d73 -r 6e0d122904f9 flys-client/src/main/java/de/intevation/flys/client/server/MapPrintServiceImpl.java
--- a/flys-client/src/main/java/de/intevation/flys/client/server/MapPrintServiceImpl.java	Tue Apr 09 11:51:29 2013 +0200
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/MapPrintServiceImpl.java	Tue Apr 09 11:53:47 2013 +0200
@@ -396,6 +396,7 @@
                     int r;
                     resp.setHeader("Content-Disposition",
                             "attachment;filename=flys-karte.pdf");
+                    resp.setContentType("application/pdf");
                     while ((r = in.read(buf)) >= 0) {
                         out.write(buf, 0, r);
                     }


More information about the Dive4elements-commits mailing list