ServeFile replies to the request with the contents of the named file or directory. If the provided file or directory name is a relative path, it is interpreted relative to the current directory and may ascend to parent directories. If the provided name is constructed from user input, it should be s
(filename string)
| 5470 | // Note that compression can be registered |
| 5471 | // through `ctx.CompressWriter(true)` or `app.Use(iris.Compression)`. |
| 5472 | func (ctx *Context) ServeFile(filename string) error { |
| 5473 | return ctx.ServeFileWithRate(filename, 0, 0) |
| 5474 | } |
| 5475 | |
| 5476 | // ServeFileWithRate same as `ServeFile` but it can throttle the speed of reading |
| 5477 | // and though writing the file to the client. |
no test coverage detected