mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 19:38:46 -05:00
[PR #7831] [CLOSED] fix: handle Unicode filenames in file download response #60973
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/7831
Author: @juananpe
Created: 12/13/2024
Status: ❌ Closed
Base:
dev← Head:fixunicodedownloadcitations📝 Commits (1)
3485beafix: handle Unicode filenames in file download response📊 Changes
1 file changed (+54 additions, -29 deletions)
View changed files
📝
backend/open_webui/apps/webui/routers/files.py(+54 -29)📄 Description
Pull Request Checklist
devbranch.Description
The file download endpoint was failing with a 400 error when trying to download files with non-ASCII characters in their filenames (like accented characters). This was due to FastAPI/Starlette attempting to encode the Content-Disposition header using latin-1 encoding.
Additionally, the implementation now properly handles both physical files and text content fallbacks with consistent filename encoding.
This PR fixes the issue by:
Changes
urllib.parse.quotefilenameand RFC 5987filename*parameters for better browser compatibility🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.