mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-27 20:07:29 -05:00
[PR #20664] [CLOSED] fix: await uploadFileHandler and preserve error message #129380
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/20664
Author: @lorenzophys
Created: 1/14/2026
Status: ❌ Closed
Base:
dev← Head:fix-await-filehandler📝 Commits (2)
6d8db4cfix: await uploadFileHandler and preserve error messageddb4e84log the httpexception📊 Changes
2 files changed (+6 additions, -2 deletions)
View changed files
📝
backend/open_webui/routers/files.py(+4 -0)📝
src/lib/components/chat/MessageInput.svelte(+2 -2)📄 Description
Changelog Entry
Description
When uploading files not allowed by the
RAG_ALLOWED_FILE_EXTENSIONSvariable, there should be a red error message in the top-right corner of the screen explaining why the upload has failed. Instead OpenWebUI fails silently, displaying only a generic violation of the CSP in the JS console.I found that the error message should already be printed, but
uploadFileHandleris not awaited, so the message doesn't actually shows. Moreover, the default error message is too generic and the user will only seeError uploading file, so I added anexceptblock to propagate a more specific error.Fixed
uploadFileHandleris now awaitedAdditional Information
Issue I opened: https://github.com/open-webui/open-webui/issues/20662
TEST: Screenshots or Videos
I performed a manual test:
Built the image with the changes:
Ran a container
Clicked the plus icon, then the attach icon, selected a zip file and this is what shows:
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.