SEBSERV-36 fixed. supported files are PNG and JPG/JPEG

This commit is contained in:
anhefti 2019-08-23 11:37:02 +02:00
parent d94ec3b391
commit b4c58bce81
2 changed files with 5 additions and 3 deletions

View file

@ -49,7 +49,9 @@ public final class ImageUpload extends Composite {
private static final Logger log = LoggerFactory.getLogger(ImageUpload.class);
public static final Set<String> SUPPORTED_IMAGE_FILES = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(
".png")));
".png",
".jpg",
".jpeg")));
private final ServerPushService serverPushService;
@ -211,7 +213,7 @@ public final class ImageUpload extends Composite {
private static boolean fileSupported(final String fileName) {
return SUPPORTED_IMAGE_FILES
.stream()
.filter(fileType -> fileName.endsWith(fileType))
.filter(fileType -> fileName.toUpperCase().endsWith(fileType.toUpperCase()))
.findFirst()
.isPresent();
}

View file

@ -129,7 +129,7 @@ sebserver.institution.form.title=Institution
sebserver.institution.form.name=Name
sebserver.institution.form.urlSuffix=URL Suffix
sebserver.institution.form.logoImage=Logo Image
sebserver.institution.form.logoImage.unsupportedFileType=The selected file is not or an unsupported image type
sebserver.institution.form.logoImage.unsupportedFileType=The selected file is not supported. Supported are: PNG and JPG
################################