mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-02 06:39:02 -05:00
[PR #22426] [CLOSED] fix: use correct attribute file.data instead of file.content in file download #81556
Reference in New Issue
Block a user
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/22426
Author: @gambletan
Created: 3/8/2026
Status: ❌ Closed
Base:
main← Head:fix/file-content-attribute-error📝 Commits (1)
264f828fix: use correct attributefile.datainstead offile.content📊 Changes
1 file changed (+1 additions, -1 deletions)
View changed files
📝
backend/open_webui/routers/files.py(+1 -1)📄 Description
Summary
In the
GET /{id}/content/{file_name}endpoint, when a file has no storage path and the code falls back to returning file content inline, it accessesfile.content.get("content", ""). However,FileModelhas nocontentattribute — the correct attribute isdata(which isOptional[dict]).This causes an
AttributeError: 'FileModel' object has no attribute 'content'crash at runtime whenever this fallback path is hit.Fix
file.content.get(...)tofile.data.get(...)Noneguard sincedataisOptional[dict]🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.