From 8ed55606c3a783a273d655c8db08eb27f385cf3e Mon Sep 17 00:00:00 2001 From: Manu Mtz-Almeida Date: Thu, 17 Jul 2014 02:01:42 +0200 Subject: [PATCH] Adds context.File(path) --- context.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/context.go b/context.go index 004bee2c..290bfffd 100644 --- a/context.go +++ b/context.go @@ -255,3 +255,8 @@ func (c *Context) Data(code int, contentType string, data []byte) { } c.Writer.Write(data) } + +// Writes the specified file into the body stream +func (c *Context) File(filepath string) { + http.ServeFile(c.Writer, c.Request, filepath) +}