Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: Validate file only when file type is set to custom (#11036)

-LAN-04f1e18342b0
diff --git a/api/factories/file_factory.py b/api/factories/file_factory.py
index a5369a38d34..1c368a22cac 100644
--- a/api/factories/file_factory.py
+++ b/api/factories/file_factory.py
@@ -241,7 +241,11 @@ def _is_file_valid_with_config(
):
return False
- if config.allowed_file_extensions and file_extension not in config.allowed_file_extensions:
+ if (
+ input_file_type == FileType.CUSTOM
+ and config.allowed_file_extensions is not None
+ and file_extension not in config.allowed_file_extensions
+ ):
return False
if config.allowed_file_upload_methods and file_transfer_method not in config.allowed_file_upload_methods: