Преглед на файлове

fix #13573 (#13843)

Signed-off-by: kenwoodjw <blackxin55+@gmail.com>
tags/1.0.0
kenwoodjw преди 8 месеца
родител
ревизия
b09f22961c
No account linked to committer's email address
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 4
    1
      api/controllers/files/image_preview.py

+ 4
- 1
api/controllers/files/image_preview.py Целия файл

@@ -1,3 +1,5 @@
from urllib.parse import quote

from flask import Response, request
from flask_restful import Resource, reqparse # type: ignore
from werkzeug.exceptions import NotFound
@@ -71,7 +73,8 @@ class FilePreviewApi(Resource):
if upload_file.size > 0:
response.headers["Content-Length"] = str(upload_file.size)
if args["as_attachment"]:
response.headers["Content-Disposition"] = f"attachment; filename={upload_file.name}"
encoded_filename = quote(upload_file.name)
response.headers["Content-Disposition"] = f"attachment; filename*=UTF-8''{encoded_filename}"

return response


Loading…
Отказ
Запис