From f51e2d5ba17141844ad0403deb978054cea73d59 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Thu, 7 Sep 2017 11:42:17 +0100 Subject: [PATCH] fix #234 Former-commit-id: 7e0b0a321a0bf352eb3530fc8d1250ba04499c87 [formerly a431ecc1f8f4d79b6ef98529ca38b7a00ba332d2] [formerly cc09c86c0b996c5c01bd4b7e65671e545e3c1828 [formerly dd7cd110db8d0d11990aee39329e01598e0337ca]] Former-commit-id: 7bd178d355de3228aa03ec3cbb814e52588ea7df [formerly 35095c2b6728944bea8173c3ea1904c632ab30b9] Former-commit-id: f2e8e8539a5ffce98ea186f42fd183710bc2f9a8 --- http/download.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/http/download.go b/http/download.go index 8f6e9f74..0fe696b7 100644 --- a/http/download.go +++ b/http/download.go @@ -25,7 +25,7 @@ func downloadHandler(c *fm.Context, w http.ResponseWriter, r *http.Request) (int if r.URL.Query().Get("inline") == "true" { w.Header().Set("Content-Disposition", "inline") } else { - w.Header().Set("Content-Disposition", "attachment; filename="+c.File.Name) + w.Header().Set("Content-Disposition", "attachment; filename=\""+c.File.Name+"\"") } http.ServeFile(w, r, c.File.Path) @@ -107,7 +107,7 @@ func downloadHandler(c *fm.Context, w http.ResponseWriter, r *http.Request) (int } defer file.Close() - w.Header().Set("Content-Disposition", "attachment; filename="+name) + w.Header().Set("Content-Disposition", "attachment; filename=\""+name+"\"") _, err = io.Copy(w, file) return 0, err }