Sfoglia il codice sorgente

fix: 修复文件下载错误

SongZihuan 3 anni fa
parent
commit
f445249068
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  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