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

Method SendFile

context/context.go:5513–5515  ·  view source on GitHub ↗

SendFile sends a file as an attachment, that is downloaded and saved locally from client. Note that compression can be registered through `ctx.CompressWriter(true)` or `app.Use(iris.Compression)`. Use `ServeFile` if a file should be served as a page asset instead.

(src string, destName string)

Source from the content-addressed store, hash-verified

5511// through `ctx.CompressWriter(true)` or `app.Use(iris.Compression)`.
5512// Use `ServeFile` if a file should be served as a page asset instead.
5513func (ctx *Context) SendFile(src string, destName string) error {
5514 return ctx.SendFileWithRate(src, destName, 0, 0)
5515}
5516
5517// SendFileWithRate same as `SendFile` but it can throttle the speed of reading
5518// and though writing the file to the client.

Callers 1

downloadFunction · 0.80

Calls 1

SendFileWithRateMethod · 0.95

Tested by

no test coverage detected