Skip to content
Permalink
Browse files

checking for the right extensions on the client side

  • Loading branch information
luiscorujo committed Dec 10, 2019
1 parent 242f4db commit 1e30f92d8a3e015efb24c5a3c63934d71bb412a3
@@ -34,11 +34,15 @@
@JsonIgnore
default String getLinkUrl() {
String[] array = {"png", "jpg", "jpeg", "gif", "raw"};
String[] extension = {"pdf", "zip", "docx", "pptx", "xlsx"};
if (Arrays.asList(array).contains(this.getFileExtension())) {
return getImageUrl();
} else {
} else if (Arrays.asList(extension).contains(this.getFileExtension())){
return getFileUrl();
}
else {
return "";
}
}

@JsonIgnore
@@ -158,7 +158,7 @@
url: FILE_UPLOAD_URL + (vars.shouldBeCropped ? '?crop=true' : ''),
dataType: 'json',
autoUpload: true,
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)\$/i,
acceptFileTypes: /(\.|\/)(gif|jpe?g|png|pdf|zip|docx|pptx|xlsx)\$/i,
maxFileSize: FILE_UPLOAD_MAX_FILE_SIZE,
// Enable image resizing, except for Android and Opera,
// which actually support image resizing, but fail to

0 comments on commit 1e30f92

Please sign in to comment.
You can’t perform that action at this time.