diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/FileTypeConstants.java b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/FileTypeConstants.java index 832db0120b..a01f8f5518 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/FileTypeConstants.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/FileTypeConstants.java @@ -31,6 +31,7 @@ public final class FileTypeConstants { public static final String RTF = "rtf"; public static final String TXT = "txt"; public static final String ODS = "ods"; + public static final String ODG = "odg"; public static final String ODP = "odp"; public static final String AVI = "avi"; public static final String MPG = "mpg"; @@ -38,6 +39,7 @@ public final class FileTypeConstants { public static final String PDF = "pdf"; public static final String JPG = "jpg"; public static final String JPEG = "jpeg"; + public static final String WEBP = "webp"; public static final String PNG = "png"; public static final String SVG = "svg"; private FileTypeConstants() {} // Prevent instantiation diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/MimeTypeUtils.java b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/MimeTypeUtils.java index 5e7372476c..b267fe2b1f 100644 --- a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/MimeTypeUtils.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/MimeTypeUtils.java @@ -19,12 +19,17 @@ public class MimeTypeUtils { private static final String RTF = "application/rtf"; private static final String TXT = "text/plain"; private static final String ODS = "application/vnd.oasis.opendocument.spreadsheet"; + private static final String ODG = "application/vnd.oasis.opendocument.graphics"; private static final String ODP = "application/vnd.oasis.opendocument.presentation"; private static final String PDF = "application/pdf"; private static final String JPEG = "image/jpeg"; private static final String PNG = "image/png"; private static final String SVG = "image/svg+xml"; + private static final String WEBP = "image/webp"; + // If the following mime-types are changed, please, make sure to also change: + // bigbluebutton-html5/private/config/settings.yml: L827 + // docs/docs/development/api.md: L1222 private static final HashMap> EXTENSIONS_MIME = new HashMap>(16) { { put(FileTypeConstants.DOC, Arrays.asList(DOC, DOCX, TIKA_MSOFFICE, TIKA_MSOFFICE_X)); @@ -34,6 +39,7 @@ public class MimeTypeUtils { put(FileTypeConstants.PPTX, Arrays.asList(PPT, PPTX, TIKA_MSOFFICE, TIKA_MSOFFICE_X)); put(FileTypeConstants.XLSX, Arrays.asList(XLS, XLSX, TIKA_MSOFFICE, TIKA_MSOFFICE_X)); put(FileTypeConstants.ODT, Arrays.asList(ODT)); + put(FileTypeConstants.ODG, Arrays.asList(ODG)); put(FileTypeConstants.RTF, Arrays.asList(RTF)); put(FileTypeConstants.TXT, Arrays.asList(TXT)); put(FileTypeConstants.ODS, Arrays.asList(ODS)); @@ -43,6 +49,7 @@ public class MimeTypeUtils { put(FileTypeConstants.JPEG, Arrays.asList(JPEG)); put(FileTypeConstants.PNG, Arrays.asList(PNG)); put(FileTypeConstants.SVG, Arrays.asList(SVG)); + put(FileTypeConstants.WEBP, Arrays.asList(WEBP)); } }; @@ -71,8 +78,9 @@ public class MimeTypeUtils { public List getValidMimeTypes() { List validMimeTypes = Arrays.asList(XLS, XLSX, - DOC, DOCX, PPT, PPTX, ODT, RTF, TXT, ODS, ODP, - PDF, JPEG, PNG, SVG, TIKA_MSOFFICE, TIKA_MSOFFICE_X + DOC, DOCX, PPT, PPTX, ODT, RTF, TXT, ODS, ODP, ODG, + PDF, JPEG, PNG, SVG, TIKA_MSOFFICE, TIKA_MSOFFICE_X, + WEBP ); return validMimeTypes; } diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/SupportedDocumentFilter.java b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/SupportedDocumentFilter.java index f566a99839..85ceed5fea 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/SupportedDocumentFilter.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/SupportedDocumentFilter.java @@ -40,7 +40,7 @@ public class SupportedDocumentFilter { /* Get file extension - Perhaps try to rely on a more accurate method than an extension type ? */ String extension = FilenameUtils.getExtension(presentationFile.getName()); - boolean supported = SupportedFileTypes.isFileSupported(extension); + boolean supported = SupportedFileTypes.isPresentationMimeTypeValid(presentationFile, extension); notifyProgressListener(supported, pres); if (supported) { log.info("Received supported file {}", pres.getUploadedFile().getAbsolutePath()); diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/SupportedFileTypes.java b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/SupportedFileTypes.java index 4e68969451..f15017ed67 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/SupportedFileTypes.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/SupportedFileTypes.java @@ -38,37 +38,21 @@ public final class SupportedFileTypes { private static Logger log = LoggerFactory.getLogger(SupportedFileTypes.class); private static MimeTypeUtils mimeTypeUtils = new MimeTypeUtils(); - - private static final List SUPPORTED_FILE_LIST = Collections.unmodifiableList(new ArrayList(15) { - { - // Add all the supported files - add(XLS); add(XLSX); add(DOC); add(DOCX); add(PPT); add(PPTX); - add(ODT); add(RTF); add(TXT); add(ODS); add(ODP); add(PDF); - add(JPG); add(JPEG); add(PNG); - } - }); private static final List OFFICE_FILE_LIST = Collections.unmodifiableList(new ArrayList(11) { { // Add all Offile file types add(XLS); add(XLSX); add(DOC); add(DOCX); add(PPT); add(PPTX); - add(ODT); add(RTF); add(TXT); add(ODS); add(ODP); + add(ODT); add(RTF); add(TXT); add(ODS); add(ODP); add(ODG); } }); private static final List IMAGE_FILE_LIST = Collections.unmodifiableList(new ArrayList(3) { { // Add all image file types - add(JPEG); add(JPG); add(PNG); + add(JPEG); add(JPG); add(PNG); add(WEBP); add(SVG); } }); - - /* - * Returns if the file with extension is supported. - */ - public static boolean isFileSupported(String fileExtension) { - return SUPPORTED_FILE_LIST.contains(fileExtension.toLowerCase()); - } /* * Returns if the Office file is supported. diff --git a/bigbluebutton-html5/private/config/settings.yml b/bigbluebutton-html5/private/config/settings.yml index ba2408fb55..a5df59a10d 100755 --- a/bigbluebutton-html5/private/config/settings.yml +++ b/bigbluebutton-html5/private/config/settings.yml @@ -821,6 +821,9 @@ public: mirroredFromBBBCore: uploadSizeMax: 30000000 uploadPagesMax: 200 + # If the following mime-types list is changed, please, make sure to also change: + # bbb-common-web/src/main/java/org/bigbluebutton/presentation/MimeTypeUtils.java: L34 (and related files.) + # docs/docs/development/api.md: L1222 uploadValidMimeTypes: - extension: .pdf mime: application/pdf @@ -848,10 +851,6 @@ public: mime: application/vnd.oasis.opendocument.presentation - extension: .odg mime: application/vnd.oasis.opendocument.graphics - - extension: .odc - mime: application/vnd.oasis.opendocument.chart - - extension: .odi - mime: application/vnd.oasis.opendocument.image - extension: .jpg mime: image/jpeg - extension: .jpeg @@ -860,6 +859,8 @@ public: mime: image/png - extension: .webp mime: image/webp + - extension: .svg + mime: image/svg+xm selectRandomUser: enabled: true countdown: false diff --git a/docs/docs/development/api.md b/docs/docs/development/api.md index cd8d3f1272..8cce8fd717 100644 --- a/docs/docs/development/api.md +++ b/docs/docs/development/api.md @@ -509,7 +509,7 @@ See [Passing custom parameters to the client on join](/administration/customize/ ### `POST` insertDocument -This endpoint insert one or more documents into a running meeting via API call +This endpoint insert one or more documents into a running meeting via API call. **Resource URL:** @@ -1214,3 +1214,47 @@ For example, the application may be able to register a URL that BigBlueButton wo - http://third-party-app/bbb-integ.php?event=meetingEnded&meetingID=abcd - http://third-party-app/bbb-integ.php?event=userLeft&userID=1234 - http://third-party-app/bbb-integ.php?event=meetingEnded&meetingID=abcd + +## Other Topics + +### Supported Document Types + +#### PDF Documents + +- PDF: + - .pdf + +#### Office Documents + +- Microsoft Word: + - .doc + - .docx +- Microsoft Excel: + - .xls + - .xlsx +- Microsoft PowerPoint: + - .ppt + - .pptx +- OpenDocument Formats: + - .odt (Text Document) + - .ods (Spreadsheet) + - .odp (Presentation) + - .odg (Graphics) + +#### Image Files + +- Common Image Formats: + - .jpg + - .jpeg + - .png + - .webp + - .svg + +#### Text Files + +- Rich Text Format: + - .rtf +- Plain Text: + - .txt + +All these valid formats are also present in a list in the [back-end](https://github.com/bigbluebutton/bigbluebutton/blob/v2.7.10/bbb-common-web/src/main/java/org/bigbluebutton/presentation/MimeTypeUtils.java#L28-L47) and in the [front-end](https://github.com/bigbluebutton/bigbluebutton/blob/v2.7.10/bigbluebutton-html5/private/config/settings.yml#L824-L862) if more details are needed.