diff --git a/backend/open_webui/retrieval/loaders/main.py b/backend/open_webui/retrieval/loaders/main.py index 971b124a9e..6e1f9fc047 100644 --- a/backend/open_webui/retrieval/loaders/main.py +++ b/backend/open_webui/retrieval/loaders/main.py @@ -94,15 +94,6 @@ known_source_ext = [ 'svg', ] -known_archive_ext = {'docx', 'epub', 'odt', 'pptx', 'xlsx'} -known_archive_content_types = { - 'application/epub+zip', - 'application/vnd.oasis.opendocument.text', - 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', -} - class ExcelLoader: """Fallback Excel loader using pandas when unstructured is not installed.""" @@ -538,7 +529,7 @@ class Loader: def _get_loader(self, filename: str, file_content_type: str, file_path: str): file_ext = filename.split('.')[-1].lower() - if file_ext in known_archive_ext or file_content_type in known_archive_content_types: + if zipfile.is_zipfile(file_path): max_file_size = self.config['rag.file.max_size'] try: max_file_size_bytes = int(max_file_size) * 1024 * 1024 if max_file_size else 100 * 1024 * 1024