Skip to content

Commit

Permalink
fix:The link of upload files is broken in the chat view pingcap#466
Browse files Browse the repository at this point in the history
  • Loading branch information
Rutheniumlmw committed Dec 24, 2024
1 parent 621e4aa commit 5c553c9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions backend/app/api/routes/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ def download_file(
headers = {"Content-Length": str(file_size)}
def iterfile():
with filestorage.open(name) as f:
while chunk := f.read(8192): # 每次读取 8KB
yield chunk
yield from f
return StreamingResponse(
iterfile(),
media_type = doc.mime_type,
Expand Down

0 comments on commit 5c553c9

Please sign in to comment.