mirror of
https://github.com/gofiber/fiber.git
synced 2025-04-27 21:25:34 +00:00
Update ctx.go
This commit is contained in:
parent
caef8be9ad
commit
0069c1b92e
1
ctx.go
1
ctx.go
@ -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]
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user