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.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
Fix wrong allowed extensions (#16893)
Yongtao Huang98f2e2c72982
diff --git a/api/core/file/upload_file_parser.py b/api/core/file/upload_file_parser.pyindex 062a0b6d225..1f81d351b6f 100644--- a/api/core/file/upload_file_parser.py+++ b/api/core/file/upload_file_parser.py@@ -4,12 +4,10 @@ import timefrom typing import Optionalfrom configs import dify_config+from constants import IMAGE_EXTENSIONSfrom core.helper.url_signer import UrlSignerfrom extensions.ext_storage import storage-IMAGE_EXTENSIONS = ["jpg", "jpeg", "png", "webp", "gif", "svg"]-IMAGE_EXTENSIONS.extend([ext.upper() for ext in IMAGE_EXTENSIONS])-class UploadFileParser:@classmethoddiff --git a/api/services/audio_service.py b/api/services/audio_service.pyindex 294dfe4c8c3..a259f5a4c42 100644--- a/api/services/audio_service.py+++ b/api/services/audio_service.py@@ -5,6 +5,7 @@ from typing import Optionalfrom werkzeug.datastructures import FileStorage+from constants import AUDIO_EXTENSIONSfrom core.model_manager import ModelManagerfrom core.model_runtime.entities.model_entities import ModelTypefrom models.model import App, AppMode, AppModelConfig, Message@@ -18,7 +19,6 @@ from services.errors.audio import (FILE_SIZE = 30FILE_SIZE_LIMIT = FILE_SIZE * 1024 * 1024-ALLOWED_EXTENSIONS = ["mp3", "mp4", "mpeg", "mpga", "m4a", "wav", "webm", "amr"]logger = logging.getLogger(__name__)@@ -44,7 +44,7 @@ class AudioService:raise NoAudioUploadedServiceError()extension = file.mimetype- if extension not in [f"audio/{ext}" for ext in ALLOWED_EXTENSIONS]:+ if extension not in [f"audio/{ext}" for ext in AUDIO_EXTENSIONS]:raise UnsupportedAudioTypeServiceError()file_content = file.read()