Send Files

目录结构

主目录sendFiles

—— files
    —— first.zip
—— main.go

示例代码

main.go

package main

import (
    "github.com/kataras/iris"
)

func main() {
    app := iris.New()
    app.Get("/", func(ctx iris.Context) {
        file := "./files/first.zip"
        ctx.SendFile(file, "c.zip")
    })
    app.Run(iris.Addr(":8080"))
}

results matching ""

    No results matching ""