From 23f6914b9bf10f017bdf45fda6b233d430212db3 Mon Sep 17 00:00:00 2001 From: xiaotian Date: Tue, 29 Apr 2025 15:38:33 +0800 Subject: [PATCH] fix: image preview triggers binary download (#19070) --- api/controllers/files/image_preview.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/controllers/files/image_preview.py b/api/controllers/files/image_preview.py index 5adfe16a79..5bb28b3897 100644 --- a/api/controllers/files/image_preview.py +++ b/api/controllers/files/image_preview.py @@ -75,7 +75,7 @@ class FilePreviewApi(Resource): if args["as_attachment"]: encoded_filename = quote(upload_file.name) response.headers["Content-Disposition"] = f"attachment; filename*=UTF-8''{encoded_filename}" - response.headers["Content-Type"] = "application/octet-stream" + response.headers["Content-Type"] = "application/octet-stream" return response