文件下载缺少文件名
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user