fix: image preview triggers binary download

pull/19070/head
xiaotian 1 year ago
parent a147d2a200
commit e7df6296a4

@ -75,7 +75,7 @@ class FilePreviewApi(Resource):
if args["as_attachment"]: if args["as_attachment"]:
encoded_filename = quote(upload_file.name) encoded_filename = quote(upload_file.name)
response.headers["Content-Disposition"] = f"attachment; filename*=UTF-8''{encoded_filename}" 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 return response

Loading…
Cancel
Save