fix: 下载文件类型不符的问题 #372

This commit is contained in:
Do1e
2025-08-05 17:25:25 +08:00
parent 7be3b27415
commit e41b3e1688
+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 # 保留原始文件名以备某些场景使用
)