Update ctx.go

pull/386/head
Fenny 2020-05-16 05:10:47 +02:00
parent caef8be9ad
commit 0069c1b92e
1 changed files with 1 additions and 0 deletions

1
ctx.go
View File

@ -285,6 +285,7 @@ func (ctx *Ctx) Cookies(key string) (value string) {
// By default, the Content-Disposition header filename= parameter is the filepath (this typically appears in the browser dialog).
// Override this default with the filename parameter.
func (ctx *Ctx) Download(file string, filename ...string) {
fname := filepath.Base(file)
if len(filename) > 0 {
fname = filename[0]
}