From 6e0b7b794a0f2e01478fd7a757eee07bae42dad9 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Mon, 6 Jul 2015 09:09:56 +0200 Subject: Upload Sizes configurable --- .../java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets') diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java index 969aee24..9e217058 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java @@ -65,9 +65,6 @@ public class ExternSignServlet extends HttpServlet { private static final String UPLOAD_PDF_DATA = "pdf-file"; private static final String UPLOAD_DIRECTORY = "upload"; - private static final int THRESHOLD_SIZE = 1024 * 1024 * 3; // 3MB - private static final int MAX_FILE_SIZE = 1024 * 1024 * 40; // 40MB - private static final int MAX_REQUEST_SIZE = 1024 * 1024 * 50; // 50MB private static final Logger logger = LoggerFactory .getLogger(ExternSignServlet.class); @@ -173,13 +170,13 @@ public class ExternSignServlet extends HttpServlet { } else { // configures upload settings DiskFileItemFactory factory = new DiskFileItemFactory(); - factory.setSizeThreshold(THRESHOLD_SIZE); + factory.setSizeThreshold(WebConfiguration.getFilesizeThreshold()); factory.setRepository(new File(System .getProperty("java.io.tmpdir"))); ServletFileUpload upload = new ServletFileUpload(factory); - upload.setFileSizeMax(MAX_FILE_SIZE); - upload.setSizeMax(MAX_REQUEST_SIZE); + upload.setFileSizeMax(WebConfiguration.getMaxFilesize()); + upload.setSizeMax(WebConfiguration.getMaxRequestsize()); // constructs the directory path to store upload file String uploadPath = getServletContext().getRealPath("") -- cgit v1.2.3