diff --git a/lib/services/services.go b/lib/services/services.go index adae0c1e..4413a833 100644 --- a/lib/services/services.go +++ b/lib/services/services.go @@ -12,6 +12,7 @@ import ( // "log" "net/http" + "net/url" "strconv" "strings" @@ -943,6 +944,8 @@ func ResponseFileWithNameAndMD5(w http.ResponseWriter, code int, fileName, path, return } SetCommonResponseHeader(w) + encodedFileName := url.PathEscape(fileName) + w.Header().Set("Content-Disposition", `attachment; filename="`+encodedFileName+`"`) w.Header().Set("Content-Type", "application/octet-stream") w.Header().Set("User-File", fileName) w.Header().Set("MD5-Sum", md5Sum)