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 gpt 4v upload image issue (#1799)

Jyong022450768f84
diff --git a/api/services/file_service.py b/api/services/file_service.py
index af665cb6529..27f95271342 100644
--- a/api/services/file_service.py
+++ b/api/services/file_service.py
@@ -30,9 +30,11 @@ class FileService:
etl_type = current_app.config['ETL_TYPE']
if etl_type == 'Unstructured':
allowed_extensions = ['txt', 'markdown', 'md', 'pdf', 'html', 'htm', 'xlsx',
- 'docx', 'csv', 'eml', 'msg', 'pptx', 'ppt', 'xml']
+ 'docx', 'csv', 'eml', 'msg', 'pptx', 'ppt', 'xml',
+ 'jpg', 'jpeg', 'png', 'webp', 'gif', 'svg']
else:
- allowed_extensions = ['txt', 'markdown', 'md', 'pdf', 'html', 'htm', 'xlsx', 'docx', 'csv']
+ allowed_extensions = ['txt', 'markdown', 'md', 'pdf', 'html', 'htm', 'xlsx', 'docx', 'csv',
+ 'jpg', 'jpeg', 'png', 'webp', 'gif', 'svg']
if extension.lower() not in allowed_extensions:
raise UnsupportedFileTypeError()
elif only_image and extension.lower() not in IMAGE_EXTENSIONS: