diff --git a/backend/open_webui/apps/webui/routers/files.py b/backend/open_webui/apps/webui/routers/files.py index 551b6d788..b8695eb67 100644 --- a/backend/open_webui/apps/webui/routers/files.py +++ b/backend/open_webui/apps/webui/routers/files.py @@ -76,7 +76,7 @@ def upload_file(file: UploadFile = File(...), user=Depends(get_verified_user)): file_item = FileModelResponse( **{ **file_item.model_dump(), - "error": e, + "error": str(e.detail) if hasattr(e, "detail") else str(e), } ) diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index 49a08176b..6dd6ff258 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -133,6 +133,10 @@ const uploadedFile = await uploadFile(localStorage.token, file); if (uploadedFile) { + if (uploadedFile.error) { + toast.warning(uploadedFile.error); + } + fileItem.status = 'uploaded'; fileItem.file = uploadedFile; fileItem.id = uploadedFile.id;