From d628ec1c3f15bd4a8ad4955553f585fde95a916d Mon Sep 17 00:00:00 2001 From: Mattia Gosetto Date: Tue, 26 Jan 2021 16:44:50 +0100 Subject: [PATCH] fix --- .../liferay/portos/bo/portlet/AllegatiManualiPortlet.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/AllegatiManualiPortlet.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/AllegatiManualiPortlet.java index 16f6455e..a38f4cf3 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/AllegatiManualiPortlet.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/AllegatiManualiPortlet.java @@ -58,6 +58,12 @@ public class AllegatiManualiPortlet extends MVCPortlet { File file = uploadRequest.getFile("docFile"); if (Validator.isNotNull(sourceFileName) && file != null) { + // validazione: solo alcune estensioni + String ext = FileUtil.getExtension(sourceFileName); + if (!ext.equalsIgnoreCase("pdf")) { + SessionErrors.add(actionRequest,"error.geniocivilefe.pratica.allegato.ext.valid"); + } + // lunghezza fissata a 200 if (sourceFileName.length() > 200) { SessionErrors.add(actionRequest, "error.geniocivilefe.allegato.manuale.length.valid");