瀏覽代碼

fix: 修复文件下载错误

SongZihuan 3 年之前
父節點
當前提交
f445249068
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      view/docx.py

+ 1 - 1
view/docx.py

@@ -97,7 +97,7 @@ def article_down_page(blog_id: int):
         return
 
     response = make_response(article.context)
-    response.headers["Content-Disposition"] = f"attachment; filename={article.title}.html"
+    response.headers["Content-Disposition"] = f"attachment;filename={article.title.encode().decode('latin-1')}.html"
     DocxApp.print_load_page_log(f"download article (id: {blog_id})")
     return response