MCPcopy Create free account
hub / github.com/kataras/iris / ServeFile

Method ServeFile

context/context.go:5472–5474  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

5470// Note that compression can be registered
5471// through `ctx.CompressWriter(true)` or `app.Use(iris.Compression)`.
5472func (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.

Callers 5

ServeFileWithRateMethod · 0.95
mainFunction · 0.80
mainFunction · 0.80
simpleAssetHandlerFunction · 0.80
mainFunction · 0.80

Calls 1

ServeFileWithRateMethod · 0.95

Tested by

no test coverage detected