Merge pull request #378 from Do1e/master

fix: 下载文件类型不符的问题 #372
This commit is contained in:
Lan
2025-08-08 21:57:56 +08:00
committed by GitHub
+1
View File
@@ -137,6 +137,7 @@ class SystemFileStorage(FileStorageInterface):
content_disposition = f"attachment; filename*=UTF-8''{encoded_filename}"
return FileResponse(
file_path,
media_type="application/octet-stream",
headers={"Content-Disposition": content_disposition},
filename=filename # 保留原始文件名以备某些场景使用
)