Update ctx.go

This commit is contained in:
Fenny 2020-05-16 05:10:47 +02:00
parent caef8be9ad
commit 0069c1b92e

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). // 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. // Override this default with the filename parameter.
func (ctx *Ctx) Download(file string, filename ...string) { func (ctx *Ctx) Download(file string, filename ...string) {
fname := filepath.Base(file)
if len(filename) > 0 { if len(filename) > 0 {
fname = filename[0] fname = filename[0]
} }