mirror of https://github.com/gin-gonic/gin.git
Adds context.File(path)
This commit is contained in:
parent
0ca4d36b76
commit
8ed55606c3
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue