1
0
mirror of https://github.com/labstack/echo.git synced 2024-12-24 20:14:31 +02:00
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana 2015-10-16 07:51:42 -07:00
parent 9ea3463d2c
commit 2cca641ffb

View File

@ -4,7 +4,7 @@ import (
"encoding/json"
"encoding/xml"
"net/http"
spath "path"
"path/filepath"
"fmt"
@ -198,7 +198,7 @@ func (c *Context) XML(code int, i interface{}) (err error) {
// to true, the client is prompted to save the file with provided `name`,
// name can be empty, in that case name of the file is used.
func (c *Context) File(path, name string, attachment bool) (err error) {
dir, file := spath.Split(path)
dir, file := filepath.Split(path)
if attachment {
c.response.Header().Set(ContentDisposition, "attachment; filename="+name)
}