1
0
mirror of https://github.com/astaxie/beego.git synced 2024-06-02 22:03:27 +00:00

Update: use PathEscape replace QueryEscape

If filename contain space(" "), QueryEscape use "+" instead.
This commit is contained in:
Sandy 2018-06-12 16:15:20 +08:00 committed by GitHub
parent f16688817a
commit bf915c3280
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -260,7 +260,7 @@ func (output *BeegoOutput) Download(file string, filename ...string) {
} else {
fName = filepath.Base(file)
}
output.Header("Content-Disposition", "attachment; filename="+url.QueryEscape(fName))
output.Header("Content-Disposition", "attachment; filename="+url.PathEscape(fName))
output.Header("Content-Description", "File Transfer")
output.Header("Content-Type", "application/octet-stream")
output.Header("Content-Transfer-Encoding", "binary")